1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-20 09:27:44 +03:00

Compress server responses

This commit is contained in:
Jan Oberhauser 2019-08-03 12:15:08 +02:00
parent 64e9b52f88
commit 1fff6e4d54
2 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,7 @@
"dist"
],
"devDependencies": {
"@types/compression": "0.0.36",
"@types/connect-history-api-fallback": "^1.3.1",
"@types/convict": "^4.2.1",
"@types/dotenv": "^6.1.1",
@ -59,6 +60,7 @@
},
"dependencies": {
"body-parser": "^1.18.3",
"compression": "^1.7.4",
"connect-history-api-fallback": "^1.6.0",
"convict": "^5.0.0",
"dotenv": "^8.0.0",

View File

@ -65,6 +65,8 @@ import * as parseUrl from 'parseurl';
import * as config from '../config';
// @ts-ignore
import * as timezones from 'google-timezones-json';
import * as compression from 'compression';
class App {
@ -112,6 +114,8 @@ class App {
private config(): void {
this.app.use(compression());
// Get push connections
this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
if (req.url.indexOf('/rest/push') === 0) {