From 407a5a3c6c1d6d4c170d7646f921bb6f2fb2f380 Mon Sep 17 00:00:00 2001 From: jw255 Date: Sat, 3 Mar 2018 16:18:01 +0000 Subject: now compiles. also added stubs for database testing --- coverage/project-code/src/app.ts.html | 197 ---------------------------------- 1 file changed, 197 deletions(-) delete mode 100644 coverage/project-code/src/app.ts.html (limited to 'coverage/project-code/src/app.ts.html') diff --git a/coverage/project-code/src/app.ts.html b/coverage/project-code/src/app.ts.html deleted file mode 100644 index 60f3e87..0000000 --- a/coverage/project-code/src/app.ts.html +++ /dev/null @@ -1,197 +0,0 @@ - - -
-| 1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 | 1x -1x -1x -1x - - - - - - -2x -2x -2x -2x - - - - -2x - - - -2x -2x - - - - -2x -2x -3x - - - - -2x -2x - - - -1x -1x -1x - - | import * as bodyParser from 'body-parser';
-import * as ex from 'express';
-import FileRouter from './FileRouter';
-import * as logger from 'morgan';
-
-class App {
- public express: ex.Express;
- private logEnabled: boolean;
-
- public constructor(enableLog: boolean) {
- this.express = ex();
- this.middleware();
- this.mountRoutes();
- this.logEnabled = enableLog;
- }
-
- // Configure Express middleware.
- private middleware(): void {
- Iif (this.logEnabled) {
- console.log("log enabled")
- this.express.use(logger('combined'));
- }
- this.express.use(bodyParser.json());
- this.express.use(bodyParser.urlencoded({ extended: false }));
- }
-
- // Configure API endpoints.
- private mountRoutes(): void {
- const defRouter: ex.Router = ex.Router();
- defRouter.get('/', (req: ex.Request, res: ex.Response): void => {
- res.json({
- message: 'Welcome to the CS3099 BE4 server!',
- important : 'Endpoints start from /cs3099group-be-4/'
- });
- });
- this.express.use('/', defRouter);
- this.express.use('/cs3099group-be-4', FileRouter);
- }
-}
-
-export default new App(true).express;
-export function TestApp(){
- return new App(false).express;
-}
- |