allow mark any page as api router #13344
Replies: 2 comments
-
+1 on this - my team needs to define its API routes behind a custom path to avoid conflicts with other pages. Having a way to configure this would be very helpful. |
Beta Was this translation helpful? Give feedback.
-
+1 on this - we have independent 3rd party service that is requesting our api on another URL. Imagine 'https://our-domain.com/api-v1/stuff/method1/param1". We don't have access on how they are trying to access us, but we have to be compatible with them. One possible solution will be to use rewrites. But docs say rewrites are only available in Node.js environment and we are targeting serverless buid. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request
Is your feature request related to a problem? Please describe.
if we want
api
not inside/page/api
folder or mixinpage
andapi
in same folderwe need use
custom server
https://nextjs.org/docs/advanced-features/custom-server
i hope can more easy control it, without config
next.config
andcustom server
Describe the solution you'd like
export
enableApiRouter
in any filewill mark this file is
api router
page/my_api.ts
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Beta Was this translation helpful? Give feedback.
All reactions