From b1072a1f0e132cdb87bdf3a78b8a06244167ee15 Mon Sep 17 00:00:00 2001 From: Travis Shivers Date: Thu, 10 Sep 2020 21:44:33 -0500 Subject: [PATCH] fix(config): make config precedence consistent with documentation --- server.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index ec7259e7..e9fdb9b0 100755 --- a/server.js +++ b/server.js @@ -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, });