Navigation Menu

Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 configuration option to disable API routing. #12122

Closed
Kurnett opened this issue Apr 23, 2020 · 2 comments
Closed

Add configuration option to disable API routing. #12122

Kurnett opened this issue Apr 23, 2020 · 2 comments
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@Kurnett
Copy link

Kurnett commented Apr 23, 2020

Feature request

Is your feature request related to a problem? Please describe.

I'm trying to use /api as a landing page that introduces users to the product's API and links them to the full documentation, but I can't find any way to disable Next's API routing - instead, it just tries to turn the page into an API endpoint.

https://nextjs.org/docs/api-routes/introduction

Describe the solution you'd like

It'd be useful to have a configuration option to disable API routing for sites built on Next that are purely for marketing purposes.

Describe alternatives you've considered

I couldn't find any relevant configuration options and all of the other issues I was able to find on Google and GitHub involved redirecting from /api to a different route. I'm most likely going to go with that option if no other solution presents itself (it's not ideal, but at least the user would get redirected to the right place), but it seems odd that this feature is enforced with no way to opt-out.

@lipoolock
Copy link

Sorry @Kurnett
I hook your post to ask if it could be possible to have a config in next.config.js to change the /api directory to another name ?

@timneutkens timneutkens added good first issue Easy to fix issues, good for newcomers help wanted labels May 25, 2020
@timneutkens
Copy link
Member

Feel free to send a PR to make /api (only pages/api.js) work as a React page.

@Timer Timer removed the help wanted label Jun 3, 2020
@vercel vercel locked and limited conversation to collaborators Dec 24, 2021
@balazsorban44 balazsorban44 converted this issue into discussion #32786 Dec 24, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants