From 32ba4cb1f41649e0f0e0b3d7e2854d70c4a9ce4a Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Fri, 14 Feb 2020 21:07:33 +0100 Subject: [PATCH] update server index file --- backend/src/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 0f5bcf8..ab1f808 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -1,18 +1,20 @@ import express from "express"; import dotenv from "dotenv"; +import * as bodyParser from 'body-parser'; + import * as routes from "./routes" +import {SERVER_PORT} from "./config"; dotenv.config(); -const port = process.env.SERVER_PORT || 8080; const app = express(); +app.use(bodyParser.json()); // Configure routes routes.register(app); - // start the Express server -app.listen(port, () => { +app.listen(SERVER_PORT, () => { // tslint:disable-next-line:no-console - console.log( `server started at http://localhost:${port}` ); -} ); + console.log(`server started at http://localhost:${SERVER_PORT}`); +});