From 8a8c42ddb2962ab4722774e7b8cc865bbef2b70f Mon Sep 17 00:00:00 2001 From: jw255 Date: Wed, 10 Jan 2018 12:58:28 +0000 Subject: updated readme, todo to explain/include changes. wrote a test for helloworld. all test files need .test.ts extension. --- dist/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dist/app.js') 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) => { -- cgit v1.2.1