skeleton/modules/localServer.js
function WwwHandler(req, res, next, local = false) {
            const parsedUrl = url.parse(req.url);

            if (parsedUrl.pathname !== '/cordova.js') {
                return next();
            }
            const parentAssetBundle = self.assetBundle.getParentAssetBundle();
            // We need to obtain a path for the initial asset bundle which usually is the parent
            // asset bundle, but if there were not HCPs yet, the main asset bundle is the
            // initial one.
            const initialAssetBundlePath =
                parentAssetBundle ?
                    parentAssetBundle.getDirectoryUri() : self.assetBundle.getDirectoryUri();

            const filePath = path.join(initialAssetBundlePath, parsedUrl.pathname);

            if (fs.existsSync(filePath)) {
                return local ?
                    createStreamProtocolResponse(filePath, res, () => {
                    }) :
                    send(req, encodeURIComponent(filePath)).pipe(res);
            }
            return next();
        }
function WwwHandler(req, res, next, local = false) {
            const parsedUrl = url.parse(req.url);

            if (parsedUrl.pathname !== '/cordova.js') {
                return next();
            }
            const parentAssetBundle = self.assetBundle.getParentAssetBundle();
            // We need to obtain a path for the initial asset bundle which usually is the parent
            // asset bundle, but if there were not HCPs yet, the main asset bundle is the
            // initial one.
            const initialAssetBundlePath =
                parentAssetBundle ?
                    parentAssetBundle.getDirectoryUri() : self.assetBundle.getDirectoryUri();

            const filePath = path.join(initialAssetBundlePath, parsedUrl.pathname);

            if (fs.existsSync(filePath)) {
                return local ?
                    createStreamProtocolResponse(filePath, res, () => {
                    }) :
                    send(req, encodeURIComponent(filePath)).pipe(res);
            }
            return next();
        }
function WwwHandler ( req , res , next , local = false ) { const parsedUrl = url . parse ( req . url ) ; if ( parsedUrl . pathname !== '/cordova.js' ) { return next ( ) ; } const parentAssetBundle = self . assetBundle . getParentAssetBundle ( ) ; // We need to obtain a path for the initial asset bundle which usually is the parent // asset bundle, but if there were not HCPs yet, the main asset bundle is the // initial one. const initialAssetBundlePath = parentAssetBundle ? parentAssetBundle . getDirectoryUri ( ) : self . assetBundle . getDirectoryUri ( ) ; const filePath = path . join ( initialAssetBundlePath , parsedUrl . pathname ) ; if ( fs . existsSync ( filePath ) ) { return local ? createStreamProtocolResponse ( filePath , res , ( ) => { } ) : send ( req , encodeURIComponent ( filePath ) ) . pipe ( res ) ; } return next ( ) ; }
Right now this is only used to serve cordova.js and it might seems like an overkill but
it will be used later for serving desktop specific files bundled into meteor bundle.

@param {Object} req    - request object
@param {Object} res    - response object
@param {Function} next - called on handler miss
@param {boolean} local - local mode
Right now this is only used to serve cordova . js and it might seems like an overkill but it will be used later for serving desktop specific files bundled into meteor bundle .