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
It'd be useful to have a configuration option to disable API routing for sites built on Next that are purely for marketing purposes.
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.
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 ?
Feel free to send a PR to make /api (only pages/api.js) work as a React page.
Most helpful comment
Sorry @Kurnett
I hook your post to ask if it could be possible to have a config in
next.config.jsto change the/apidirectory to another name ?