Skip to content

Commit

Permalink
Option of disabling HTTP-server
Browse files Browse the repository at this point in the history
For those only interested in MQTT.
  • Loading branch information
svenove authored Aug 4, 2017
1 parent e6b5bc3 commit b25af87
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ var mqttClient = config.hasOwnProperty("mqtt_options") ?
mqtt.connect(config.mqtt_host);
var TOPIC_NAMESPACE = config.topic_namespace || "harmony-api";

var enableHTTPserver = config.hasOwnProperty("enableHTTPserver") ?
config.enableHTTPserver : true;

var app = express()
app.use(bodyParser.urlencoded({ extended: false }))
app.use(express.static(path.join(__dirname, 'public')));
Expand Down Expand Up @@ -560,4 +563,6 @@ app.get('/hubs_for_index', function(req, res){
res.send(output)
})

app.listen(process.env.PORT || 8282)
if (enableHTTPserver) {
app.listen(process.env.PORT || 8282)
}

0 comments on commit b25af87

Please sign in to comment.