Mark different routes as "API routes" #16817
ivanpetrushev
started this conversation in
Ideas
Replies: 1 comment
-
Duplicate of #13344 |
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.
-
Feature request
Is your feature request related to a problem? Please describe.
We have to proxy several routes to a 3rd party service like in this example: #14057 (comment)
This is working only in api routes and in Next.js api routes reside only in
pages/api/
directory.We need paths other than
http://domain.com/api/
to be server as API routes.Describe the solution you'd like
Probably config list in next.config.js containing a list of directories in
pages/
that should be interpreted as API routes?Probably HOC that can be used like:
I am open to other alternatives as well.
Describe alternatives you've considered
Maybe we can use
rewrites
to change the API routes to desired paths, BUT - docs state rewrites are available only in Node.js environment and we are targeting serverless build.Thanks.
Beta Was this translation helpful? Give feedback.
All reactions