diff options
| author | jw255 | 2018-02-22 16:57:45 +0000 |
|---|---|---|
| committer | jw255 | 2018-02-22 16:57:45 +0000 |
| commit | 77bfad0307f4e5daea0584a30b0dcf24ccc9ec42 (patch) | |
| tree | 42ce68ae0ebe939d6492a39616158278ed0f61d6 /src/app.ts | |
| parent | Merge branch 'trh/yarn' into trh/payload-checker (diff) | |
| download | medicine-77bfad0307f4e5daea0584a30b0dcf24ccc9ec42.tar.gz medicine-77bfad0307f4e5daea0584a30b0dcf24ccc9ec42.zip | |
restructuring of tests
Diffstat (limited to 'src/app.ts')
| -rw-r--r-- | src/app.ts | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -5,17 +5,19 @@ import * as logger from 'morgan'; class App { public express: ex.Express; - public logEnabled: boolean = true; + private logEnabled: boolean; - public constructor() { + public constructor(enableLog: boolean) { this.express = ex(); this.middleware(); this.mountRoutes(); + this.logEnabled = enableLog; } // Configure Express middleware. private middleware(): void { if (this.logEnabled) { + console.log("log enabled") this.express.use(logger('combined')); } this.express.use(bodyParser.json()); @@ -36,4 +38,7 @@ class App { } } -export default new App().express; +export default new App(true).express; +export function TestApp(){ + return new App(false).express; +} |
