From 56b06b5ee36ed83fc44d0775b6218aa8fed85b5e Mon Sep 17 00:00:00 2001 From: jw255 Date: Tue, 10 Apr 2018 21:29:15 +0100 Subject: fixed auth tests --- src/app.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/app.ts') diff --git a/src/app.ts b/src/app.ts index c627027..91b8f95 100644 --- a/src/app.ts +++ b/src/app.ts @@ -101,7 +101,8 @@ class App { important: 'Endpoints start from /cs3099group-be-4/' }); }); - defRouter.get('/*', (req: ex.Request, res: ex.Response): void => { + const errRouter: ex.Router = ex.Router(); + errRouter.get('/*', (req: ex.Request, res: ex.Response): void => { res.status(404) .json({ status: 'error', @@ -112,6 +113,7 @@ class App { this.express.use('/cs3099group-be-4', FileRouter); this.express.use('/cs3099group-be-4', authRouter); this.express.use('/', defRouter); + this.express.use('/XX*', errRouter); } /** -- cgit v1.2.1 From f7220be4e1b80cdba0fbaf41f7382cbf18561e2b Mon Sep 17 00:00:00 2001 From: jw255 Date: Tue, 10 Apr 2018 23:30:51 +0100 Subject: sth works maybe --- src/app.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/app.ts') diff --git a/src/app.ts b/src/app.ts index 91b8f95..1378177 100644 --- a/src/app.ts +++ b/src/app.ts @@ -161,6 +161,7 @@ class App { req: ex.Request, res: ex.Response, next: ex.NextFunction, project: string ): Promise => { + console.log("## as " + project) res.locals.project = await Project.findOne({ where: { name: project -- cgit v1.2.1