all files / modules/utils/ bindApp.js

50% Statements 3/6
100% Branches 0/0
0% Functions 0/1
50% Lines 3/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15                        
const createRequestHandler = require("./createRequestHandler");
 
/**
 * Binds the given app to the "request" event of the given node HTTP server
 * so that it is called whenever the server receives a new request. Returns
 * the request handler function.
 */
function bindApp(app, nodeServer) {
    const requestHandler = createRequestHandler(app);
    nodeServer.on("request", requestHandler);
    return requestHandler;
}
 
module.exports = bindApp;