Add dotenv module to manage environment variables

This commit is contained in:
Dario Genga
2019-12-03 00:18:04 +01:00
parent 1939d88457
commit 302d6abbde
19 changed files with 261 additions and 4 deletions

View File

@ -1,9 +1,12 @@
require("dotenv").config();
import * as express from "express";
import * as bodyParser from "body-parser";
import * as status from "http-status";
require("./mapping");
const app = express();
const port = 3000
const port = process.env.NODE_PORT || 3000;
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
@ -21,5 +24,5 @@ app.get('/', (req, res) => {
});
app.listen(port, () => {
console.log(`Example app listening on port ${port}!`)
console.log(`Example app listening on port ${port}!`);
});