Updates for docker enablement 2

This commit is contained in:
ShahanaFarooqui 2019-02-12 08:36:04 -05:00
parent b4d26365c6
commit 812df26fca
14 changed files with 177 additions and 106 deletions

10
rtl.js
View file

@ -1,20 +1,17 @@
const app = require("./app");
const common = require("./common");
const debug = require("debug")("node-angular");
const http = require("http");
const normalizePort = val => {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
common.port = port;
return port;
}
return false;
};
@ -47,8 +44,7 @@ const onListening = () => {
debug("Listening on " + bind);
};
const port = normalizePort(process.env.PORT || "3000");
app.set("port", port);
const port = normalizePort(process.env.PORT || common.port);
const server = http.createServer(app);
server.on("error", onError);