api: add API_LISTEN_ADDRESS env for specifying bind address
This commit is contained in:
@@ -194,7 +194,7 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) {
|
||||
res.redirect('/api/json')
|
||||
});
|
||||
|
||||
app.listen(env.apiPort, () => {
|
||||
app.listen(env.apiPort, env.listenAddress, () => {
|
||||
console.log(`\n` +
|
||||
`${Cyan("cobalt")} API ${Bright(`v.${version}-${gitCommit} (${gitBranch})`)}\n` +
|
||||
`Start time: ${Bright(`${startTime.toUTCString()} (${startTimestamp})`)}\n\n` +
|
||||
|
||||
@@ -29,6 +29,7 @@ const
|
||||
apiEnvs = {
|
||||
apiPort: process.env.API_PORT || 9000,
|
||||
apiName: process.env.API_NAME || 'unknown',
|
||||
listenAddress: process.env.API_LISTEN_ADDRESS,
|
||||
corsWildcard: process.env.CORS_WILDCARD !== '0',
|
||||
corsURL: process.env.CORS_URL,
|
||||
cookiePath: process.env.COOKIE_PATH,
|
||||
|
||||
Reference in New Issue
Block a user