app.js
/**
 * Creates and start the service's web server
 * @param {!Application} app the app object to use in the service
 * @return {!Object} a promise creating the web server
 */
Creates and start the service's web server
@param {!Application} app the app object to use in the service
@return {!Object} a promise creating the web server
Creates and start the service ' s web server @param { !Application } app the app object to use in the service @return { !Object } a promise creating the web server
function createServer(app) {
    let server;
    return new BBPromise((resolve) => {
        server = http.createServer(app).listen(
            app.conf.port,
            app.conf.interface,
            resolve
        );
        server = addShutdown(server);
    }).then(() => {
        app.logger.log('info',
            `Worker ${process.pid} listening on ${app.conf.interface || '*'}:${app.conf.port}`);
        server.on("connection", (socket) => {
            socket.setNoDelay(true);
        });
        return server;
    });
}
function createServer ( app ) { let server ; return new BBPromise ( ( resolve ) => { server = http . createServer ( app ) . listen ( app . conf . port , app . conf . interface , resolve ) ; server = addShutdown ( server ) ; } ) . then ( ( ) => { app . logger . log ( 'info' , ` ${ process . pid } ${ app . conf . interface || '*' } ${ app . conf . port } ` ) ; server . on ( "connection" , ( socket ) => { socket . setNoDelay ( true ) ; } ) ; return server ; } ) ; }
Creates and start the service's web server
 @param {!Application} app the app object to use in the service
 @return {!Object} a promise creating the web server
Creates and start the service ' s web server @param { !Application } app the app object to use in the service @return { !Object } a promise creating the web server
// return a promise which creates an HTTP server, // attaches the app to it, and starts accepting // incoming client requests // Don't delay incomplete packets for 40ms (Linux default) on // pipelined HTTP sockets. We write in large chunks or buffers, so // lack of coalescing should not be an issue here.