mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-06 03:49:40 +00:00
Add support for running in production with dev.js config, node index --prod-with-dev-env
This commit is contained in:
parent
d21fe49ce2
commit
e384863148
2 changed files with 5 additions and 2 deletions
6
index.js
6
index.js
|
|
@ -4,7 +4,9 @@ const optionDefinitions = [
|
|||
{ name: 'port', alias: 'p', type: String },
|
||||
{ name: 'host', alias: 'h', type: String },
|
||||
{ name: 'source', alias: 's', type: String },
|
||||
{ name: 'dev', alias: 'd', type: Boolean }
|
||||
{ name: 'dev', alias: 'd', type: Boolean },
|
||||
// Run in production mode and use dev.js config
|
||||
{ name: 'prod-with-dev-env', alias: 'r', type: Boolean }
|
||||
]
|
||||
|
||||
const commandLineArgs = require('./server/libs/commandLineArgs')
|
||||
|
|
@ -17,7 +19,7 @@ const server = require('./server/Server')
|
|||
global.appRoot = __dirname
|
||||
|
||||
const isDev = process.env.NODE_ENV !== 'production'
|
||||
if (isDev) {
|
||||
if (isDev || options['prod-with-dev-env']) {
|
||||
const devEnv = require('./dev').config
|
||||
if (devEnv.Port) process.env.PORT = devEnv.Port
|
||||
if (devEnv.ConfigPath) process.env.CONFIG_PATH = devEnv.ConfigPath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue