mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Compress server responses
This commit is contained in:
parent
64e9b52f88
commit
1fff6e4d54
|
@ -39,6 +39,7 @@
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/compression": "0.0.36",
|
||||||
"@types/connect-history-api-fallback": "^1.3.1",
|
"@types/connect-history-api-fallback": "^1.3.1",
|
||||||
"@types/convict": "^4.2.1",
|
"@types/convict": "^4.2.1",
|
||||||
"@types/dotenv": "^6.1.1",
|
"@types/dotenv": "^6.1.1",
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.18.3",
|
"body-parser": "^1.18.3",
|
||||||
|
"compression": "^1.7.4",
|
||||||
"connect-history-api-fallback": "^1.6.0",
|
"connect-history-api-fallback": "^1.6.0",
|
||||||
"convict": "^5.0.0",
|
"convict": "^5.0.0",
|
||||||
"dotenv": "^8.0.0",
|
"dotenv": "^8.0.0",
|
||||||
|
|
|
@ -65,6 +65,8 @@ import * as parseUrl from 'parseurl';
|
||||||
import * as config from '../config';
|
import * as config from '../config';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import * as timezones from 'google-timezones-json';
|
import * as timezones from 'google-timezones-json';
|
||||||
|
import * as compression from 'compression';
|
||||||
|
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
|
|
||||||
|
@ -112,6 +114,8 @@ class App {
|
||||||
|
|
||||||
private config(): void {
|
private config(): void {
|
||||||
|
|
||||||
|
this.app.use(compression());
|
||||||
|
|
||||||
// Get push connections
|
// Get push connections
|
||||||
this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
|
this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||||
if (req.url.indexOf('/rest/push') === 0) {
|
if (req.url.indexOf('/rest/push') === 0) {
|
||||||
|
|
Loading…
Reference in a new issue