make fallback middleware which responds with 404 not found
This commit is contained in:
@@ -47,6 +47,10 @@ app.use(express.static(path.join(__dirname, "public"), {
|
|||||||
app.use("/api/docs", swaggerUi.serve, swaggerUi.setup(specs));
|
app.use("/api/docs", swaggerUi.serve, swaggerUi.setup(specs));
|
||||||
app.use("/api", apiRouter);
|
app.use("/api", apiRouter);
|
||||||
|
|
||||||
|
app.use((req, res) => {
|
||||||
|
res.status(404).send("Not Found");
|
||||||
|
})
|
||||||
|
|
||||||
// has to be last
|
// has to be last
|
||||||
app.use((_req, res, _next) => {
|
app.use((_req, res, _next) => {
|
||||||
const err = res.error;
|
const err = res.error;
|
||||||
|
|||||||
Reference in New Issue
Block a user