src/live.js
function startServer(alerts, params, port, resources) {
    const compiledAlerts = compileMarkdown(alerts);
    const app = http.createServer((req, res) =>
        res.end(resources[req.url] || resources['/index.html']));
    const io = listen(app);
    io.on('connection', socket => {
        emitInfo(`new session for ${socket.handshake.address}`);
        socket.emit('update', compiledAlerts);
        socket.on('disconnect', () => {
            emitInfo(`disconnected session ${socket.handshake.address}`);
        });
    });

    return new Promise(resolve => app.listen(port, emitRungEmoji & resolve))
        .then(~watchChanges(io, params));
}
function startServer(alerts, params, port, resources) {
    const compiledAlerts = compileMarkdown(alerts);
    const app = http.createServer((req, res) =>
        res.end(resources[req.url] || resources['/index.html']));
    const io = listen(app);
    io.on('connection', socket => {
        emitInfo(`new session for ${socket.handshake.address}`);
        socket.emit('update', compiledAlerts);
        socket.on('disconnect', () => {
            emitInfo(`disconnected session ${socket.handshake.address}`);
        });
    });

    return new Promise(resolve => app.listen(port, emitRungEmoji & resolve))
        .then(~watchChanges(io, params));
}
function startServer ( alerts , params , port , resources ) { const compiledAlerts = compileMarkdown ( alerts ) ; const app = http . createServer ( ( req , res ) => res . end ( resources [ req . url ] || resources [ '/index.html' ] ) ) ; const io = listen ( app ) ; io . on ( 'connection' , socket => { emitInfo ( ` ${ socket . handshake . address } ` ) ; socket . emit ( 'update' , compiledAlerts ) ; socket . on ( 'disconnect' , ( ) => { emitInfo ( ` ${ socket . handshake . address } ` ) ; } ) ; } ) ; return new Promise ( resolve => app . listen ( port , emitRungEmoji & resolve ) ) . then ( ~ watchChanges ( io , params ) ) ; }
Starts the stream server using sockets

@param {Object} alerts
@param {Object} params
@param {Number} port
@param {Object} resources
@return {Promise}
Starts the stream server using sockets