Skip to content

Commit

Permalink
fix: force debug logging and fix default route response (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmstss authored and rielas committed Jun 14, 2024
1 parent 2c79784 commit 3709cd3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ async function bootstrap() {
server.setDefaultRoute((req, res) => {
if (req.url && req.url.startsWith('/api')) {
res.statusCode = 404;
return res.end({
success: false,
error: {
kind: 'user_input',
message: 'Not Found',
},
});
return res.end(
JSON.stringify({
success: false,
error: {
kind: 'user_input',
message: 'Not Found',
},
}),
);
}

readFile(
Expand Down Expand Up @@ -160,7 +162,7 @@ async function bootstrap() {
AppModule,
new FastifyAdapter(server),
{
logger: process.env.NODE_ENV === 'production' ? ['error'] : ['debug'],
logger: /*process.env.NODE_ENV === 'production' ? ['error'] :*/ ['debug'],
},
);

Expand Down

0 comments on commit 3709cd3

Please sign in to comment.