Browse Source

Apply middleware in correct order

umbrel
Pavel Ševčík 3 years ago
parent
commit
7e44694c5d
No known key found for this signature in database GPG Key ID: D3B8A90B4072D9DB
  1. 8
      lib/http-server/http-server.js

8
lib/http-server/http-server.js

@ -34,12 +34,14 @@ class HttpServer {
this.app.set('trust proxy', 'loopback')
// Middlewares for json responses and requests logging
this.app.use('/static', sirv('../static'));
this.app.use(HttpServer.setJSONResponse)
this.app.use(HttpServer.requestLogger)
this.app.use(HttpServer.setCrossOrigin)
this.app.use(HttpServer.setConnection)
this.app.use(helmet(HttpServer.HELMET_POLICY))
this.app.use('/static', sirv('../static'));
this.app.use(HttpServer.setJSONResponse)
this.app.use(HttpServer.setConnection)
}

Loading…
Cancel
Save