modules/orionode.debug.server/lib/debugFile.js
function createDebugFileRouter(adapterPool) {
    var router = express.Router();

    router.get('/:connectionId/:referenceId/*', function(req, res) {
        if (!adapterPool.has(req.params.connectionId)) {
            res.sendStatus(404);
            return;
        }
        var adapter = adapterPool.get(req.params.connectionId);
        adapter.sendRequest('source', { sourceReference: parseInt(req.params.referenceId, 10) }, TIMEOUT, function(response) {
            if (!response.success) {
                res.sendStatus(404);
                return;
            } else {
                if (response.body.mimeType) {
                    res.setHeader('Content-Type', response.body.mimeType);
                }
                res.write(response.body.content);
                res.end();
            }
        });
    });

    return router;
}
function createDebugFileRouter(adapterPool) {
    var router = express.Router();

    router.get('/:connectionId/:referenceId/*', function(req, res) {
        if (!adapterPool.has(req.params.connectionId)) {
            res.sendStatus(404);
            return;
        }
        var adapter = adapterPool.get(req.params.connectionId);
        adapter.sendRequest('source', { sourceReference: parseInt(req.params.referenceId, 10) }, TIMEOUT, function(response) {
            if (!response.success) {
                res.sendStatus(404);
                return;
            } else {
                if (response.body.mimeType) {
                    res.setHeader('Content-Type', response.body.mimeType);
                }
                res.write(response.body.content);
                res.end();
            }
        });
    });

    return router;
}
function createDebugFileRouter ( adapterPool ) { var router = express . Router ( ) ; router . get ( '/:connectionId/:referenceId/*' , function ( req , res ) { if ( ! adapterPool . has ( req . params . connectionId ) ) { res . sendStatus ( 404 ) ; return ; } var adapter = adapterPool . get ( req . params . connectionId ) ; adapter . sendRequest ( 'source' , { sourceReference : parseInt ( req . params . referenceId , 10 ) } , TIMEOUT , function ( response ) { if ( ! response . success ) { res . sendStatus ( 404 ) ; return ; } else { if ( response . body . mimeType ) { res . setHeader ( 'Content-Type' , response . body . mimeType ) ; } res . write ( response . body . content ) ; res . end ( ) ; } } ) ; } ) ; return router ; }
Create a router for debug file
@param {Map.<string, DebugAdapter>} adapterPool
@return {Express.Router}
Create a router for debug file