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.
This commit is contained in:
Spenser Bushey 2022-12-10 22:11:28 -08:00
parent ef56714573
commit aa336cfeb4
2 changed files with 14 additions and 1 deletions

11
dev.default.js Normal file
View file

@ -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:\\<path_to_ffmpeg>\\ffmpeg.exe'
FFProbePath: 'ffprobe'
}

View file

@ -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