Make API config search path consistent with backend.

The API configuration now accepts the same DOUGAL_ROOT
environment variable as the backend and uses the same
path algorithm.
This commit is contained in:
D. Berge
2020-08-12 15:11:54 +02:00
parent d66e3dd661
commit 9453d14ee5

View File

@@ -2,7 +2,8 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const crypto = require('crypto'); const crypto = require('crypto');
const cfgPath = process.env.DOUGAL_API_CONFIG || (process.env.HOME+"/etc/www/config.json"); const cfgPrefix = process.env.DOUGAL_ROOT || ((process.env.HOME || ".") + "/software");
const cfgPath = process.env.DOUGAL_API_CONFIG || (cfgPrefix+"/etc/www/config.json");
let config = {} let config = {}