diff options
author | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-09-18 21:01:06 +0200 |
---|---|---|
committer | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-09-18 21:03:23 +0200 |
commit | 157f29536ac43c2d423e218eea78ee58bf7e80f6 (patch) | |
tree | 2ce42696f4f074b7250d424510eae246a6ff134f /api | |
parent | Merge pull request #375 from TheArcaneBrony/request-logging (diff) | |
download | server-157f29536ac43c2d423e218eea78ee58bf7e80f6.tar.xz |
Fix environment variable name to work on non-Windows platforms
Diffstat (limited to 'api')
-rw-r--r-- | api/src/Server.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/api/src/Server.ts b/api/src/Server.ts index bda19db5..4a226d12 100644 --- a/api/src/Server.ts +++ b/api/src/Server.ts @@ -40,22 +40,22 @@ export class FosscordServer extends Server { /* - DOCUMENTATION: uses log-requests environment variable + DOCUMENTATION: uses LOG_REQUESTS environment variable # only log 200 and 204 - log-requests=200 204 + LOG_REQUESTS=200 204 # log everything except 200 and 204 - log-requests=-200 204 + LOG_REQUESTS=-200 204 # log all requests - log-requests=- + LOG_REQUESTS=- */ - - let logRequests = process.env["log-requests"] != undefined; + + let logRequests = process.env["LOG_REQUESTS"] != undefined; if(logRequests) { this.app.use(morgan("combined", { skip: (req, res) => { - var skip = !(process.env["log-requests"]?.includes(res.statusCode.toString()) ?? false); - if(process.env["log-requests"]?.charAt(0) == '-') skip = !skip; + var skip = !(process.env["LOG_REQUESTS"]?.includes(res.statusCode.toString()) ?? false); + if(process.env["LOG_REQUESTS"]?.charAt(0) == '-') skip = !skip; return skip; } })); @@ -91,7 +91,7 @@ export class FosscordServer extends Server { TestClient(this.app); if(logRequests){ - console.log("Warning: Request logging is enabled! This will spam your console!\nTo disable this, unset the 'log-requests' environment variable!"); + console.log("Warning: Request logging is enabled! This will spam your console!\nTo disable this, unset the 'LOG_REQUESTS' environment variable!"); } return super.start(); } |