synclounge/server.js

24 lines
597 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
const syncloungeServer = require('syncloungeserver');
2020-09-16 04:52:11 +00:00
const path = require('path');
const config = require('./config');
const blockList = Object.keys(syncloungeServer.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 = syncloungeServer.getConfig();
syncloungeServer.socketServer({
...socketConfig,
2020-09-16 04:52:11 +00:00
static_path: path.join(__dirname, 'dist'),
preStaticInjection,
});