chore(v2): Integrate middleware and htmlfallback middlewear usage #1891
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integrating farm dev server has
all middleware
functions and the impact ofappType
on configuringspa
,mpa
andcustom
fields functionsThe following is a brief explanation of the core points of this pr, only about the appType function
The functions of each part of the middleware in the following order are as follows
The following functional areas are divided into two points
htmlFallbackMiddleware
andnotFoundMiddleware
will not be usedif the appType is set to
spa
, but the user passes in multiple inputs at this timeThen the following paths are valid as
if the appType is set to
spa
,effective:
localhost:3000
localhost:3000/
localhost:3000/123456
localhost:3000/index.html
localhost:3000/base.html
localhost:3000/about.html
if the appType is set to
mpa
this
localhost:3000/123456
will be not effective return undefinedif the appType is set to
custom
Then we will not control the situation where middlewareMode is currently only set to true in the user's functional scenario for returning html
Subsequent pr will analyze all scenarios and functions of each middleware in detail