19 lines
394 B
TypeScript
19 lines
394 B
TypeScript
|
|
import express from "express";
|
||
|
|
import dotenv from "dotenv";
|
||
|
|
import * as routes from "./routes"
|
||
|
|
|
||
|
|
dotenv.config();
|
||
|
|
|
||
|
|
const port = process.env.SERVER_PORT || 8080;
|
||
|
|
const app = express();
|
||
|
|
|
||
|
|
// Configure routes
|
||
|
|
routes.register(app);
|
||
|
|
|
||
|
|
|
||
|
|
// start the Express server
|
||
|
|
app.listen(port, () => {
|
||
|
|
// tslint:disable-next-line:no-console
|
||
|
|
console.log( `server started at http://localhost:${port}` );
|
||
|
|
} );
|