update server index file
This commit is contained in:
@@ -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}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user