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

Feature - API Routes #116

Closed
mattdell opened this issue Aug 6, 2019 · 1 comment
Closed

Feature - API Routes #116

mattdell opened this issue Aug 6, 2019 · 1 comment
Labels
enhancement New feature or request nextjs 9.0

Comments

@mattdell
Copy link
Contributor

mattdell commented Aug 6, 2019

NextJS 9 has introduced the concept of API Routes which allows for the creation of API endpoints within the pages folder.

Best to read the documentation here as it does a better job of explaining than I could do myself: https://github.com/zeit/next.js#api-routes

In the interest of feature parity, shall we work to support this?

danielcondemarin pushed a commit that referenced this issue Aug 14, 2019
There are only a few minor issues with the current implementation to
get this going, namely:

- Allowing POST, PATCH etc. in Cloudfront.
- Checking if the NextJS page is a React component or not.

The change to `compatLayer.js` is needed so that if a request without
a body is sent to an API the Stream still has some content. Without
a `_read() is not implemented` is raised which generates an HTTP 400
response without a body.

The stream test case is removed since the stream already has EOF pushed
to it. Don't think there is a use case where the input is a stream
itself.

#116
@danielcondemarin danielcondemarin added enhancement New feature or request nextjs 9.0 labels Aug 14, 2019
@mattdell
Copy link
Contributor Author

I'm going to close this with the merge of #117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nextjs 9.0
Projects
None yet
Development

No branches or pull requests

2 participants