Skip to content

Commit 7673ee5

Browse files
committed
[fastboot-app-server] turn on gzip by default
1 parent 9c9f1c9 commit 7673ee5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/fastboot-app-server/src/express-http-server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22

33
const express = require('express');
4+
const compression = require('compression');
45
const basicAuth = require('./basic-auth');
56

67
function noop() {}
@@ -14,7 +15,7 @@ class ExpressHTTPServer {
1415
this.username = options.username;
1516
this.password = options.password;
1617
this.cache = options.cache;
17-
this.gzip = options.gzip || false;
18+
this.gzip = options.gzip || true;
1819
this.host = options.host;
1920
this.port = options.port;
2021
this.beforeMiddleware = options.beforeMiddleware || noop;
@@ -31,7 +32,7 @@ class ExpressHTTPServer {
3132
this.beforeMiddleware(app);
3233

3334
if (this.gzip) {
34-
this.app.use(require('compression')());
35+
this.app.use(compression());
3536
}
3637

3738
if (username !== undefined || password !== undefined) {

0 commit comments

Comments
 (0)