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

add requestHandler fall-through - closes #1295 #1297

Merged

Conversation

Rich-Harris
Copy link
Contributor

Changes

This closes #1295, by allowing requestHandler to fall through to other handlers:

snowpackServer.requestHandler(req, res, () => {
  // requested URL didn't correspond to file managed by Snowpack,
  // respond with a custom 404
});

Testing

I couldn't quickly figure out where to add a test for this. Will gladly add a test if given pointers

Docs

requestHandler is currently undocumented

@Rich-Harris Rich-Harris requested a review from a team as a code owner October 13, 2020 19:10
@vercel
Copy link

vercel bot commented Oct 13, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/nzb9d0tz7
✅ Preview: https://snowpack-git-request-handler-fallthrough.pikapkg.vercel.app

Copy link
Owner

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! looks like GitHub Actions is down (or at least, giving us strange internal errors) so assuming tests are passing and will confirm locally after merging.

@FredKSchott FredKSchott merged commit aa06d5d into FredKSchott:master Oct 13, 2020
@Rich-Harris Rich-Harris deleted the request-handler-fallthrough branch October 13, 2020 21:37
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.

Allow next argument to requestHandler
2 participants