diff options
| author | jw255 | 2018-01-10 12:58:28 +0000 |
|---|---|---|
| committer | jw255 | 2018-01-10 12:58:28 +0000 |
| commit | 8a8c42ddb2962ab4722774e7b8cc865bbef2b70f (patch) | |
| tree | cd5a20138c05e0135febf875f36de0173d7f89fd /dist/app.js | |
| parent | modified README and made a script to install all packages, compile ts and run... (diff) | |
| download | medicine-8a8c42ddb2962ab4722774e7b8cc865bbef2b70f.tar.gz medicine-8a8c42ddb2962ab4722774e7b8cc865bbef2b70f.zip | |
updated readme, todo to explain/include changes. wrote a test for helloworld. all test files need .test.ts extension.
Diffstat (limited to 'dist/app.js')
| -rw-r--r-- | dist/app.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dist/app.js b/dist/app.js index 7e34ef9..e983ca8 100644 --- a/dist/app.js +++ b/dist/app.js @@ -1,11 +1,20 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const express = require("express"); +const logger = require("morgan"); +const bodyParser = require("body-parser"); class App { constructor() { this.express = express(); + this.middleware(); this.mountRoutes(); } + // Configure Express middleware. + middleware() { + this.express.use(logger('combined')); + this.express.use(bodyParser.json()); + this.express.use(bodyParser.urlencoded({ extended: false })); + } mountRoutes() { const router = express.Router(); router.get('/', (req, res) => { |
