aboutsummaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorjw2552018-02-24 19:34:20 +0000
committerjw2552018-02-24 19:34:20 +0000
commit80f5aeb37b3d997015238173499f4a067ec0c266 (patch)
treee3c15df8099c861ba81758c62d92770e5d5d93ee /src/app.ts
parentrestructuring of tests + yarn install script (diff)
downloadmedicine-80f5aeb37b3d997015238173499f4a067ec0c266.tar.gz
medicine-80f5aeb37b3d997015238173499f4a067ec0c266.zip

tests now actually test what they are supposed to and catch errors if needed

Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/app.ts b/src/app.ts
index ef4485e..612ba49 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -33,8 +33,18 @@ class App {
important : 'Endpoints start from /cs3099group-be-4/'
});
});
- this.express.use('/', defRouter);
+ defRouter.get('/*', (req: ex.Request, res: ex.Response): void => {
+ res.status(404)
+ .json({
+ status: 'error',
+ error : 'invalid_route',
+ error_description: 'Endpoints start from /cs3099group-be-4/\n'
+ +' Please refer to \'https://github.com/CS3099JH2017/cs3099jh/blob/master/protocols/BE01.md\''
+ + ' for further details.'
+ });
+ })
this.express.use('/cs3099group-be-4', FileRouter);
+ this.express.use('/', defRouter);
}
}