aboutsummaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorTom Harley2018-03-07 16:00:54 +0000
committerTom Harley2018-03-07 16:00:54 +0000
commite338c8ce35f22812ae1de5303a06edde166ba8cf (patch)
treee80a4f060816b57a60357fb832bb7bcbeac78b0a /src/app.ts
parentMerge remote-tracking branch 'origin/testing-middleware' into development (diff)
parentAdding support for the protocol's supported_views thing and laid base work fo... (diff)
downloadmedicine-e338c8ce35f22812ae1de5303a06edde166ba8cf.tar.gz
medicine-e338c8ce35f22812ae1de5303a06edde166ba8cf.zip

Merge branch ‘cjd24/conversion’ into development

Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/app.ts b/src/app.ts
index 8c55faa..025164b 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -4,7 +4,7 @@ import * as expressJwt from 'express-jwt';
import * as logger from 'morgan';
import * as passport from 'passport';
-import { default as authRouter, unauthorisedErr } from './auth';
+import { default as authRouter, isAdmin, unauthorisedErr } from './auth';
import { RequestError, errorHandler } from './errors/errorware';
import FileRouter from './FileRouter';
@@ -90,9 +90,7 @@ class App {
.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.'
+ error_description: 'Endpoints start from /cs3099group-be-4/'
});
});
this.express.use('/cs3099group-be-4', FileRouter);
@@ -237,6 +235,7 @@ export default new App(true).express;
/**
* A version of the app used only for testing.
*/
-export function TestApp() {
+// tslint:disable-next-line:variable-name
+export const TestApp: () => ex.Express = (): ex.Express => {
return new App(false).express;
-}
+};