diff --git a/dev.default.js b/dev.default.js new file mode 100644 index 000000000..60f0b3334 --- /dev/null +++ b/dev.default.js @@ -0,0 +1,11 @@ +// DO NOT MODIFY THIS FILE +// Copy this file to dev.js to make modifications + +const Path = require('path') +module.exports.config = { + Port: 3333, // Using port 3333 is important when running the client web app separately + ConfigPath: Path.resolve('config'), + MetadataPath: Path.resolve('metadata'), + FFmpegPath: 'ffmpeg', // On Windows, use 'C:\\\\ffmpeg.exe' + FFProbePath: 'ffprobe' +} diff --git a/index.js b/index.js index 19a24d820..777d70889 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,11 @@ const server = require('./server/Server') +const fs = require('fs') global.appRoot = __dirname const isDev = process.env.NODE_ENV !== 'production' if (isDev) { - const devEnv = require('./dev').config + const devFile = fs.existsSync('./dev.js') ? './dev' : './dev.default' + const devEnv = require(devFile).config process.env.NODE_ENV = 'development' process.env.PORT = devEnv.Port process.env.CONFIG_PATH = devEnv.ConfigPath