make fallback middleware which responds with 404 not found

This commit is contained in:
2025-09-12 13:40:45 +02:00
parent f831f0b386
commit 03dbc5a82a

View File

@@ -47,6 +47,10 @@ app.use(express.static(path.join(__dirname, "public"), {
app.use("/api/docs", swaggerUi.serve, swaggerUi.setup(specs));
app.use("/api", apiRouter);
app.use((req, res) => {
res.status(404).send("Not Found");
})
// has to be last
app.use((_req, res, _next) => {
const err = res.error;