refactor: add devMessage field (useful in front-end)

This commit is contained in:
Methapon2001 2024-04-02 15:26:37 +07:00
parent aefbc965ab
commit ba65c1fe83
3 changed files with 14 additions and 1 deletions

View file

@ -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}`));