Skip to content

Provide an option to configure the API route path #8123

@oliviertassinari

Description

@oliviertassinari

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions