From aa336cfeb4dd17d7c10e6970e80234e7a18967f3 Mon Sep 17 00:00:00 2001 From: Spenser Bushey Date: Sat, 10 Dec 2022 22:11:28 -0800 Subject: [PATCH] Add dev.default.js file Added default dev file. Allows users to customize with existing dev.js, but environment can work out of the box most of the time. --- dev.default.js | 11 +++++++++++ index.js | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 dev.default.js 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