skeleton/modules/localServer.js
function IndexHandler(req, res, next, local = false) {
            const parsedUrl = url.parse(req.url);
            if (!parsedUrl.pathname.startsWith(self.localFilesystemUrl) &&
                parsedUrl.pathname !== '/favicon.ico'
            ) {
                /** @type {Asset} */
                const indexFile = self.assetBundle.getIndexFile();
                if (local) {
                    createStreamProtocolResponse(indexFile.getFile(), res, () => {
                    });
                } else {
                    send(req, encodeURIComponent(indexFile.getFile())).pipe(res);
                }
            } else {
                next();
            }
        }
function IndexHandler(req, res, next, local = false) {
            const parsedUrl = url.parse(req.url);
            if (!parsedUrl.pathname.startsWith(self.localFilesystemUrl) &&
                parsedUrl.pathname !== '/favicon.ico'
            ) {
                /** @type {Asset} */
                const indexFile = self.assetBundle.getIndexFile();
                if (local) {
                    createStreamProtocolResponse(indexFile.getFile(), res, () => {
                    });
                } else {
                    send(req, encodeURIComponent(indexFile.getFile())).pipe(res);
                }
            } else {
                next();
            }
        }
function IndexHandler ( req , res , next , local = false ) { const parsedUrl = url . parse ( req . url ) ; if ( ! parsedUrl . pathname . startsWith ( self . localFilesystemUrl ) && parsedUrl . pathname !== '/favicon.ico' ) { /** @type {Asset} */ const indexFile = self . assetBundle . getIndexFile ( ) ; if ( local ) { createStreamProtocolResponse ( indexFile . getFile ( ) , res , ( ) => { } ) ; } else { send ( req , encodeURIComponent ( indexFile . getFile ( ) ) ) . pipe ( res ) ; } } else { next ( ) ; } }
Serves index.html as the last resort.

@param {Object} req        - request object
@param {Object} res        - response object
@param {Function} next     - called on handler miss
@param {boolean} local - local mode
Serves index . html as the last resort .