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

Provide an option to configure the API route path #8123

Closed
oliviertassinari opened this issue Jul 26, 2019 · 5 comments
Closed

Provide an option to configure the API route path #8123

oliviertassinari opened this issue Jul 26, 2019 · 5 comments

Comments

@oliviertassinari
Copy link
Contributor

Feature request

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

Next.js v9.0.0 hard codes the route name of the API path: /api/.

https://github.com/zeit/next.js/blob/71f9288a54c32420a18a07035ea7a73c9c3c50e5/packages/next/lib/constants.ts#L19

In Material-UI, we host pages under the /api/ folder. For instance: https://v3.material-ui.com/api/app-bar/. It forces us to rename this folder. This has an SEO impact.

Describe the solution you'd like

We would be interested in having an option to configure this path. For instance, I could imagine something like:

next.config.js

module.exports = {
  apiRoutePath: 'json-api',
};

Additional context

@timneutkens
Copy link
Member

It's actually not super simple to change it, and I'd rather not if not really required. We have talked about a page-level opt-out thought, but haven't really had community interest until now.

@eps1lon
Copy link
Member

eps1lon commented Jul 26, 2019

We have talked about a page-level opt-out

That would work for our use case. Will take a look at making this work. Any things I should pay extra attention to?

@timneutkens
Copy link
Member

It's slightly complicated as this also ties into the serverless target and hosting (@now/next). I'll have @huv1k take a look 👍

@timneutkens
Copy link
Member

Closing this in favor of #9081

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants