refactor: add devMessage field (useful in front-end)
This commit is contained in:
parent
aefbc965ab
commit
ba65c1fe83
3 changed files with 14 additions and 1 deletions
|
|
@ -20,6 +20,14 @@ const APP_PORT = +(process.env.APP_PORT || 3000);
|
|||
|
||||
RegisterRoutes(app);
|
||||
|
||||
app.get("*", (_, res) =>
|
||||
res.status(404).send({
|
||||
status: 404,
|
||||
message: "Route not found.",
|
||||
devMessage: "unknown_url",
|
||||
}),
|
||||
);
|
||||
|
||||
app.use(error);
|
||||
|
||||
app.listen(APP_PORT, APP_HOST, () => console.log(`Listening on: http://localhost:${APP_PORT}`));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue