2020-02-14 07:53:18 +01:00
|
|
|
import express from "express";
|
|
|
|
|
import dotenv from "dotenv";
|
2020-02-14 21:07:33 +01:00
|
|
|
import * as bodyParser from 'body-parser';
|
|
|
|
|
|
2020-02-14 07:53:18 +01:00
|
|
|
import * as routes from "./routes"
|
2020-02-14 21:07:33 +01:00
|
|
|
import {SERVER_PORT} from "./config";
|
2020-02-14 07:53:18 +01:00
|
|
|
|
|
|
|
|
dotenv.config();
|
|
|
|
|
|
|
|
|
|
const app = express();
|
2020-02-14 21:07:33 +01:00
|
|
|
app.use(bodyParser.json());
|
2020-02-14 07:53:18 +01:00
|
|
|
|
|
|
|
|
// Configure routes
|
|
|
|
|
routes.register(app);
|
|
|
|
|
|
|
|
|
|
// start the Express server
|
2020-02-14 21:07:33 +01:00
|
|
|
app.listen(SERVER_PORT, () => {
|
2020-02-14 07:53:18 +01:00
|
|
|
// tslint:disable-next-line:no-console
|
2020-02-14 21:07:33 +01:00
|
|
|
console.log(`server started at http://localhost:${SERVER_PORT}`);
|
|
|
|
|
});
|