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.json
indist
to include or exclude files but this seems to have no effect.functions/_middleware.ts
I've tried many combos but given a
_routes.json
like this:The middleware is still called on everything, e.g:
What I would like to do is have a
_middleware.ts
which does two things:On certain routes like
/dashboard
check 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.html
outputAny help appreciated
P.S. I start dev like this:
Beta Was this translation helpful? Give feedback.
All reactions