How to stop Page Function middleware being called on everything? #2832
Unanswered
dominictobias
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation says that I can place a
_routes.jsonindistto include or exclude files but this seems to have no effect.functions/_middleware.tsI've tried many combos but given a
_routes.jsonlike this:{ "version": 1, "include": ["/favicon.png"], "exclude": [] }The middleware is still called on everything, e.g:
What I would like to do is have a
_middleware.tswhich does two things:On certain routes like
/dashboardcheck a session cookie and redirect if not authorizedOn every route that is not a real asset i.e. a html5 pushState route e.g.
/dashboard, modify the respondingindex.htmloutputAny help appreciated
P.S. I start dev like this:
Beta Was this translation helpful? Give feedback.
All reactions