mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 03:31:46 +00:00
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:
parent
ef56714573
commit
aa336cfeb4
2 changed files with 14 additions and 1 deletions
11
dev.default.js
Normal file
11
dev.default.js
Normal 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'
|
||||||
|
}
|
||||||
4
index.js
4
index.js
|
|
@ -1,9 +1,11 @@
|
||||||
const server = require('./server/Server')
|
const server = require('./server/Server')
|
||||||
|
const fs = require('fs')
|
||||||
global.appRoot = __dirname
|
global.appRoot = __dirname
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV !== 'production'
|
const isDev = process.env.NODE_ENV !== 'production'
|
||||||
if (isDev) {
|
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.NODE_ENV = 'development'
|
||||||
process.env.PORT = devEnv.Port
|
process.env.PORT = devEnv.Port
|
||||||
process.env.CONFIG_PATH = devEnv.ConfigPath
|
process.env.CONFIG_PATH = devEnv.ConfigPath
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue