bin/server/sans-server.js
function timeout(seconds) {
    return function timeoutSet(req, res, next) {
        const timeoutId = setTimeout(() => {
            if (!res.sent) res.sendStatus(504)
        }, 1000 * seconds);

        req.hook('response', Number.MAX_SAFE_INTEGER - 1000, function timeoutClear(req, res, next) {
            clearTimeout(timeoutId);
            next();
        });

        next();
    };
}
function timeout(seconds) {
    return function timeoutSet(req, res, next) {
        const timeoutId = setTimeout(() => {
            if (!res.sent) res.sendStatus(504)
        }, 1000 * seconds);

        req.hook('response', Number.MAX_SAFE_INTEGER - 1000, function timeoutClear(req, res, next) {
            clearTimeout(timeoutId);
            next();
        });

        next();
    };
}
function timeout ( seconds ) { return function timeoutSet ( req , res , next ) { const timeoutId = setTimeout ( ( ) => { if ( ! res . sent ) res . sendStatus ( 504 ) } , 1000 * seconds ) ; req . hook ( 'response' , Number . MAX_SAFE_INTEGER - 1000 , function timeoutClear ( req , res , next ) { clearTimeout ( timeoutId ) ; next ( ) ; } ) ; next ( ) ; } ; }
Request middleware to apply timeouts to the request.
@param {number} seconds
@returns {function}
Request middleware to apply timeouts to the request .