skeleton/modules/localServer.js
function AssetHandler(req, res, next, local = false) {
            const parsedUrl = url.parse(req.url);
            // Check if we have an asset for that url defined.
            /** @type {Asset} */
            const asset = self.assetBundle.assetForUrlPath(parsedUrl.pathname);

            if (!asset) return next();

            const processors = () => (
                addSourceMapHeader(asset, res),
                addETagHeader(asset, res),
                addCacheHeader(asset, res, req.url)
            );

            if (local) {
                return createStreamProtocolResponse(asset.getFile(), res, processors);
            }
            return send(
                req,
                encodeURIComponent(asset.getFile()),
                { etag: false, cacheControl: false }
            )
                .on('file', processors)
                .pipe(res);
        }
function AssetHandler(req, res, next, local = false) {
            const parsedUrl = url.parse(req.url);
            // Check if we have an asset for that url defined.
            /** @type {Asset} */
            const asset = self.assetBundle.assetForUrlPath(parsedUrl.pathname);

            if (!asset) return next();

            const processors = () => (
                addSourceMapHeader(asset, res),
                addETagHeader(asset, res),
                addCacheHeader(asset, res, req.url)
            );

            if (local) {
                return createStreamProtocolResponse(asset.getFile(), res, processors);
            }
            return send(
                req,
                encodeURIComponent(asset.getFile()),
                { etag: false, cacheControl: false }
            )
                .on('file', processors)
                .pipe(res);
        }
function AssetHandler ( req , res , next , local = false ) { const parsedUrl = url . parse ( req . url ) ; // Check if we have an asset for that url defined. /** @type {Asset} */ const asset = self . assetBundle . assetForUrlPath ( parsedUrl . pathname ) ; if ( ! asset ) return next ( ) ; const processors = ( ) => ( addSourceMapHeader ( asset , res ) , addETagHeader ( asset , res ) , addCacheHeader ( asset , res , req . url ) ) ; if ( local ) { return createStreamProtocolResponse ( asset . getFile ( ) , res , processors ) ; } return send ( req , encodeURIComponent ( asset . getFile ( ) ) , { etag : false , cacheControl : false } ) . on ( 'file' , processors ) . pipe ( res ) ; }
Provides assets defined in the manifest.

@param {Object} req    - request object
@param {Object} res    - response object
@param {Function} next - called on handler miss
@param {boolean} local - local mode
Provides assets defined in the manifest .