added config parameter 'dev' to trigger development mode

This commit is contained in:
Daniel Sommer 2022-03-29 16:37:49 +02:00
parent a5c6801a4b
commit 585e381417
2 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,5 @@
{
"dev": true,
"server": {
"listen": "0.0.0.0",
"port": 3000

View file

@ -154,9 +154,10 @@ async function parseCurrentPedalboard(currentPedalboard) {
if (currentPedalboard.uri === undefined) {
throw new Error('could not determine current pedalboard config file');
}
// FAKE DATA
let file = path.resolve(path.dirname(__dirname) + '/dev/' + currentPedalboard.uri.substring(currentPedalboard.uri.lastIndexOf('/') + 1));
// let file = path.resolve(currentPedalboard.uri.replace('file://', ''));
let file = path.resolve(currentPedalboard.uri.replace('file://', ''));
if (global.config?.dev) {
file = path.resolve(path.dirname(__dirname) + '/dev/' + currentPedalboard.uri.substring(currentPedalboard.uri.lastIndexOf('/') + 1));
}
const data = await new Promise((resolve, reject) => {
fs.readFile(file, (err, data) => {
if (err) {