diff --git a/server/src/server/server.ts b/server/src/server/server.ts index 2b3f5f0e6..d2734f145 100644 --- a/server/src/server/server.ts +++ b/server/src/server/server.ts @@ -85,10 +85,6 @@ if (Environment.nodeEnv !== "production" && IsNonEmptyString(ServerConfig.CLIENT next(); }); - if (ServerConfig.ENABLE_METRICS) { - app.use(ExpressPromBundle({ includeMethod: true, includePath: true })); - } - // hack to allow all OPTIONS requests. Remember that this setting should not be on in production! if (ServerConfig.OPTIONS_ALWAYS_SUCCEEDS === true) { app.options("*", (req, res) => res.send()); @@ -113,6 +109,10 @@ if (Environment.nodeEnv !== "production" && IsNonEmptyString(ServerConfig.CLIENT app.use(helmet()); } +if (ServerConfig.ENABLE_METRICS) { + app.use(ExpressPromBundle({ includeMethod: true, includePath: true })); +} + app.use(userSessionMiddleware); // Most of these options are leveraged from KTAPI