mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2026-08-13 12:33:07 +02:00
Updates for docker enablement 2
This commit is contained in:
parent
b4d26365c6
commit
812df26fca
14 changed files with 177 additions and 106 deletions
10
rtl.js
10
rtl.js
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue