[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),
|
||||
"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 {
|
||||
http.createServer(app).listen(settings.general.listen);
|
||||
http.createServer(app).listen(settings.general.listen.port, settings.general.listen.host);
|
||||
}
|
|
@ -2,8 +2,11 @@
|
|||
"general": {
|
||||
//serve https or http?
|
||||
//generate certs in ./snakeoil before activating this
|
||||
"https": false,
|
||||
"listen": 3000
|
||||
"https": false,
|
||||
"listen": {
|
||||
"host": "localhost",
|
||||
"port": 3000
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"key": "snakeoil/privkey.pem",
|
||||
|
|
Loading…
Reference in New Issue