# HG changeset patch # User Andrew Azores # Date 1506028130 14400 # Node ID 362ef36b1cefc682a386dcc68f71746cf0f02259 # Parent b686b8d2463897a1dbf18300c27a561cb3ecc43f Allow overriding /gatewayUrl response in express server Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-September/025149.html diff -r b686b8d24638 -r 362ef36b1cef server.js --- a/server.js Thu Sep 21 16:26:15 2017 -0400 +++ b/server.js Thu Sep 21 17:08:50 2017 -0400 @@ -32,6 +32,7 @@ var port = process.env.PORT || 8080; var host = process.env.HOST || '0.0.0.0'; +var gatewayUrl = process.env.GATEWAY_URL || 'http://localhost:8888/'; var app = express(); app.use(cors()); @@ -48,5 +49,5 @@ app.get('/gatewayurl', function (req, res, next) { res.setHeader('Content-Type', 'application/json'); - res.send(JSON.stringify({ gatewayUrl: 'http://localhost:8888/' })); + res.send(JSON.stringify({ gatewayUrl: gatewayUrl })); });