[TASK] Add option to define the host to listen on.
This commit is contained in:
parent
5bbc879029
commit
f91afabfd1
4
app.js
4
app.js
|
@ -53,7 +53,7 @@ if(settings.general.https == true) {
|
||||||
"cert": fs.readFileSync(settings.https.cert),
|
"cert": fs.readFileSync(settings.https.cert),
|
||||||
"key": fs.readFileSync(settings.https.key)
|
"key": fs.readFileSync(settings.https.key)
|
||||||
};
|
};
|
||||||
https.createServer(httpsOptions, app).listen(settings.general.listen);
|
https.createServer(httpsOptions, app).listen(settings.general.listen.port, settings.general.listen.host);
|
||||||
} else {
|
} else {
|
||||||
http.createServer(app).listen(settings.general.listen);
|
http.createServer(app).listen(settings.general.listen.port, settings.general.listen.host);
|
||||||
}
|
}
|
|
@ -2,8 +2,11 @@
|
||||||
"general": {
|
"general": {
|
||||||
//serve https or http?
|
//serve https or http?
|
||||||
//generate certs in ./snakeoil before activating this
|
//generate certs in ./snakeoil before activating this
|
||||||
"https": false,
|
"https": false,
|
||||||
"listen": 3000
|
"listen": {
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 3000
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"https": {
|
"https": {
|
||||||
"key": "snakeoil/privkey.pem",
|
"key": "snakeoil/privkey.pem",
|
||||||
|
|
Loading…
Reference in New Issue