Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const config = require('./config.json');
const uw = uwave(config);
// Register your Media Sources. The API keys are configured in the config.json
// file.
uw.source(youTubeSource, config.youtube);
uw.source(soundCloudSource, config.soundcloud);
const secret = Buffer.from(config.secret);
const httpApi = createHttpApi(uw, {
secret,
});
const webClient = createWebClient(uw, {
apiBase: '/api',
});
const app = express();
const server = app.listen(port);
app.use('/api', httpApi);
createSocketServer(uw, {
// This needs an HTTP server to attach the WebSocket server to.
server,
secret,
});
app.use(webClient);