sapper
sapper copied to clipboard
Added "any" method and fixed `res.write()`
-
Added "any" field Many web frameworks allowing you to match all HTTP methods. https://expressjs.com/en/4x/api.html#app.all for example.
-
See https://nodejs.org/api/http.html#http_response_write_chunk_encoding_callback
res.write()must return boolean, but it doesn't because data got intercepted.
Before submitting the PR, please make sure you do the following
- [x] It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
- [x] This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
- [ ] Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to
npm run lint!)
Tests
- [ ] Run the tests tests with
npm testoryarn test)
Can you update the documentation in https://github.com/sveltejs/sapper/blob/master/site/content/docs/02-routing.md#server-routes ?
Could we change any to default so it's aligned with Next.js? (Next.js only has export default which acts as any)
Sorry this had gone unreviewed for so long. It looks like there's a merge conflict here. Maybe it's better to try to make sure SvelteKit works as desired than trying to get it in here at this point?
SvelteKit 1.0 is now out and Sapper is deprecated, so I'm going to close this