Replies: 1 comment
-
You could use the rewrites functionality in your module.exports = {
async rewrites() {
return [
{
source: '/api',
destination: '/foo', // pages/foo.js
},
];
},
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We would like to have a page that is accessed at domain.com/api. As the /api folder in /pages is reserved for API routes, I'm wondering id there is a way to make this happen. Choosing not to have any API routes and having an api.js does not seem to work.
Is having an /api page not possible at all with Next or is there a way to make this possible, has anybody does something like this?
Beta Was this translation helpful? Give feedback.
All reactions