With the following configuration
export default {
appIndex: "./src/index.html",
rootDir: "./"
}
The appIndex will be ignored unless the URL starts with /src/, leading to a 404 HTTP response.
This seems to be an intentional behavior of the historyApiFallbackMiddleware (see the line 38)
I cannot see any benefits of this behavior. The actual location of the html file ./src/index.html shouldn't have anything to do with the URL pattern.
Why force a URL prefix based on the actual location of the html file?
I suggest removing the following if statement:
if (!ctx.url.startsWith(appIndexBrowserPathPrefix)) {
return next();
}
Am I missing something here? @LarsDenBakker
With the following configuration
The
appIndexwill be ignored unless the URL starts with/src/, leading to a 404 HTTP response.This seems to be an intentional behavior of the
historyApiFallbackMiddleware(see the line 38)I cannot see any benefits of this behavior. The actual location of the html file
./src/index.htmlshouldn't have anything to do with the URL pattern.Why force a URL prefix based on the actual location of the html file?
I suggest removing the following if statement:
Am I missing something here? @LarsDenBakker