Allow specifying host to bind via BIND env var
This commit is contained in:
parent
e7eb6a08bd
commit
d4e6dfbf60
@ -121,7 +121,8 @@ variables. For example:
|
|||||||
- Change base URL: `PEERCALLS__BASE_URL=/test` - app will now be accessible at `localhost:3000/test`
|
- Change base URL: `PEERCALLS__BASE_URL=/test` - app will now be accessible at `localhost:3000/test`
|
||||||
- Enable HTTPS: `PEERCALLS__SSL='{"cert": "/path/to/cert.pem", "key": "/path/to/cert.key"}'`
|
- Enable HTTPS: `PEERCALLS__SSL='{"cert": "/path/to/cert.pem", "key": "/path/to/cert.key"}'`
|
||||||
- Disable HTTPS: `PEERCALLS__SSL=undefined`
|
- Disable HTTPS: `PEERCALLS__SSL=undefined`
|
||||||
- Listen on a different port: `PORT=3001`
|
- Listen on a different port: `PORT=3001` (default is `3000`)
|
||||||
|
- Bind to specific IP or hostname: `BIND=127.0.0.1`
|
||||||
|
|
||||||
See [config/default.yaml][config] for sample configuration.
|
See [config/default.yaml][config] for sample configuration.
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,11 @@ import app from './server/app'
|
|||||||
|
|
||||||
const debug = _debug('peercalls')
|
const debug = _debug('peercalls')
|
||||||
|
|
||||||
const port = process.env.PORT || 3000
|
const port = parseInt(process.env.PORT || '') || 3000
|
||||||
app.listen(port, () => debug('Listening on: %s', port))
|
const hostname = process.env.BIND
|
||||||
|
const server = app.listen(
|
||||||
|
port, hostname, () => debug('Listening on %s', server.address()))
|
||||||
|
|
||||||
|
|
||||||
process.on('SIGINT', () => process.exit())
|
process.on('SIGINT', () => process.exit())
|
||||||
process.on('SIGTERM', () => process.exit())
|
process.on('SIGTERM', () => process.exit())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user