fix(config): make config precedence consistent with documentation

This commit is contained in:
Travis Shivers 2020-09-10 21:44:33 -05:00
parent 56c515b153
commit b1072a1f0e
No known key found for this signature in database
GPG Key ID: EE4CC2891B8FCD33
1 changed files with 9 additions and 6 deletions

View File

@ -16,13 +16,16 @@ const blockList = Object.keys(syncloungeSocket.defaultConfig);
const appConfig = config.get(null, blockList);
console.log(appConfig);
const preStaticInjection = (router) => {
// Add route for config
router.get('/config.json', (req, res) => {
res.json(appConfig);
});
};
const socketConfig = syncloungeSocket.getConfig();
const router = syncloungeSocket.socketServer({
syncloungeSocket.socketServer({
...socketConfig,
static_path: 'dist',
});
// Add route for config
router.get('/config.json', (req, res) => {
res.json(appConfig);
preStaticInjection,
});