2020-08-24 00:00:26 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
2020-09-26 23:09:27 +00:00
|
|
|
const syncloungeServer = require('syncloungeserver');
|
2020-09-16 04:52:11 +00:00
|
|
|
const path = require('path');
|
2020-08-24 00:00:26 +00:00
|
|
|
const config = require('./config');
|
|
|
|
|
2020-09-26 23:09:27 +00:00
|
|
|
const blockList = Object.keys(syncloungeServer.defaultConfig);
|
2020-08-31 22:55:14 +00:00
|
|
|
const appConfig = config.get(null, blockList);
|
2020-08-24 00:00:26 +00:00
|
|
|
console.log(appConfig);
|
|
|
|
|
2020-09-11 02:44:33 +00:00
|
|
|
const preStaticInjection = (router) => {
|
|
|
|
// Add route for config
|
|
|
|
router.get('/config.json', (req, res) => {
|
|
|
|
res.json(appConfig);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-09-26 23:09:27 +00:00
|
|
|
const socketConfig = syncloungeServer.getConfig();
|
|
|
|
syncloungeServer.socketServer({
|
2020-08-24 01:08:44 +00:00
|
|
|
...socketConfig,
|
2020-09-16 04:52:11 +00:00
|
|
|
static_path: path.join(__dirname, 'dist'),
|
2020-09-11 02:44:33 +00:00
|
|
|
preStaticInjection,
|
2020-08-31 22:55:14 +00:00
|
|
|
});
|