update server index file

This commit is contained in:
Bilal Catic
2020-02-14 21:07:33 +01:00
parent a91df8d6cc
commit 32ba4cb1f4

View File

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