🐛 Fix bug with slow push messages

This commit is contained in:
Jan Oberhauser 2019-08-06 20:44:36 +02:00
parent b395eddd66
commit 573c0e77c5

View file

@ -149,9 +149,6 @@ class App {
});
}
// Compress the repsonse data
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) {
@ -167,6 +164,9 @@ class App {
next();
});
// Compress the response data
this.app.use(compression());
// Make sure that each request has the "parsedUrl" parameter
this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
(req as ICustomRequest).parsedUrl = parseUrl(req);