From 0a09d6fb8a4959f7c4a4c2070994693ce8bdaec2 Mon Sep 17 00:00:00 2001 From: Hu Chen Date: Sat, 22 Jun 2019 14:34:06 +0800 Subject: [PATCH] feat: set default route to repositories --- src/server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server.ts b/src/server.ts index 507cf4a..6e3dae2 100644 --- a/src/server.ts +++ b/src/server.ts @@ -32,7 +32,7 @@ app.get( ); app.get( - '/repositories', + '(/|/repositories)', async (req: Request, res: Response): Promise => { try { const parsedUrl = url.parse(req.originalUrl); @@ -115,6 +115,10 @@ app.post( } ); +app.use((req, res) => { + res.sendStatus(404); +}); + app.listen( PORT, (): ApiResponse => {