diff options
| author | Tom Harley | 2018-04-11 14:13:28 +0100 |
|---|---|---|
| committer | Tom Harley | 2018-04-11 14:13:28 +0100 |
| commit | e9fda66656a1e36e79e26fa46af554c5ccf3f6bc (patch) | |
| tree | 55a663df93771b1c13c44d02451f7e62e765017e /src/app.ts | |
| parent | WIP: Add support for raw and meta views (diff) | |
| parent | oh god (diff) | |
| download | medicine-e9fda66656a1e36e79e26fa46af554c5ccf3f6bc.tar.gz medicine-e9fda66656a1e36e79e26fa46af554c5ccf3f6bc.zip | |
Merge branch ‘development’ into trh/gets
Diffstat (limited to 'src/app.ts')
| -rw-r--r-- | src/app.ts | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -104,7 +104,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', @@ -115,6 +116,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); } /** @@ -162,6 +164,7 @@ class App { req: ex.Request, res: ex.Response, next: ex.NextFunction, project: string ): Promise<void> => { + console.log("## as " + project) res.locals.project = await Project.findOne({ where: { name: project |
