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}`); +});