Skip to content

Commit

Permalink
Check LOGGING env-var for "true" (#78)
Browse files Browse the repository at this point in the history
LOGGING env var should be exlicitly set to "true", in order to log
requests.

Currently it just needs to be truethy, which doesn't correspond with the
the current default value in the example .env.local file (where it's
"false").
Explicit "true" is also how other env-vars are checked, eg
https://github.com/microsoft/code-push-server/blob/08e97d751620ad7867bb0c9b94633e94f2c01c68/api/script/default-server.ts#L110
  • Loading branch information
grav authored Feb 12, 2025
1 parent 08e97d7 commit 2330e45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/script/default-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function start(done: (err?: any, server?: express.Express, storage?: Stor
next();
});

if (process.env.LOGGING) {
if (process.env.LOGGING === "true") {
app.use((req: express.Request, res: express.Response, next: (err?: any) => void): any => {
console.log(); // Newline to mark new request
console.log(`[REST] Received ${req.method} request at ${req.originalUrl}`);
Expand Down

0 comments on commit 2330e45

Please # to comment.