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

'Create' API route not working when using new Route Handler functionality in NextJS13 #6

Open
sgandolfo opened this issue Apr 28, 2023 · 1 comment

Comments

@sgandolfo
Copy link

The current setup of the 'Create API key' route has been setup using the old 'Pages/Api' setup of NextJS. When copying this logic to the new Route Handler logic of NextJS 13, this does no longer work.

I have fixed the issue and refactored the 'Create API Keys' route so that it works with the latest functionality of Route Handlers. This new way of working with the ROUTE handlers also eliminates the need of the 'withMethods' middleware function to limit the HTTP methods that can call the route.

I can create a PR if you want.

Current NextJS version that I am using is: 13.3.1

@joschan21
Copy link
Owner

Hi, thanks for the issue! Please create a PR for this. I'd be happy to merge your changes into a new branch to not confuse people expecting the original code in the master branch.

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

No branches or pull requests

2 participants