Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse execution order of Pages Functions middlewares #217

Merged
merged 2 commits into from
Jan 7, 2022

Conversation

GregBrimble
Copy link
Member

@GregBrimble GregBrimble commented Jan 7, 2022

Fixes #110

Reverses the execution order of Pages Functions middlewares.

Now, a directory like

- functions
  - _middleware.ts     // a
  - api
    - _middleware.ts   // b
    - todo
      - _middleware.ts // c
      - d.ts

will execute with the order, a -> b -> c -> d, for requests to /api/todo/d

@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2022

🦋 Changeset detected

Latest commit: ee4d6be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@GregBrimble GregBrimble changed the title Apply-middleware-in-reverse-order Reverse execution order of Pages Functions middlewares Jan 7, 2022
@GregBrimble GregBrimble force-pushed the apply-middleware-in-reverse-order branch from 6ea4e43 to ee4d6be Compare January 7, 2022 22:49
@GregBrimble GregBrimble merged commit 777f4d5 into main Jan 7, 2022
@GregBrimble GregBrimble deleted the apply-middleware-in-reverse-order branch January 7, 2022 23:28
@github-actions github-actions bot mentioned this pull request Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Middleware execution order inverted when using a deeper directory structure
2 participants