Merge pull request #1 from linuxserver/custom_port

Add custom port via variable
This commit is contained in:
Ryan Kuba 2020-06-24 16:27:48 -07:00 committed by GitHub
commit b2d0fe7014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
app.js
View File

@ -6,6 +6,7 @@ var ejs = require('ejs');
var express = require('express');
var app = require('express')();
var http = require('http').Server(app);
var CUSTOM_PORT = process.env.CUSTOM_PORT || 3000;
///// Guac Websocket Tunnel ////
var GuacamoleLite = require('guacamole-lite');
@ -71,7 +72,7 @@ app.get("/", function (req, res) {
});
// Spin up application on port 3000
http.listen(3000, function(){
console.log('listening on *:3000');
// Spin up application on CUSTOM_PORT with fallback to port 3000
http.listen(CUSTOM_PORT, function(){
console.log('listening on *:' + CUSTOM_PORT);
});