Rename /api route ? #13346
-
Hello dear community, I know this might be a hard no, but hear me out. The situation is my Next.js app sits next to a an other app that's already using In an act of despair, I tried using a normal page and use getInitialProps to perform my server-side call and output it raw in the render method, but of course it's nasty, not maintainable, has poor performances and is pretty stupid. I tried to search on this topic but couldn't find much really. Thanks a lot :) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 15 replies
-
Unfortunately the Depending on your proxy setup, you could "whitelist" the API routes associated with Next while your other API handles the other routes. |
Beta Was this translation helpful? Give feedback.
-
This is kind of a hack I guess but it works perfectly with next@13.2.4 as far as I've seen, based on https://nextjs.org/docs/pages/building-your-application/configuring/custom-server but modified:
|
Beta Was this translation helpful? Give feedback.
-
How can we use nextauth with this I have my fastapi in the root folder but seem like the root folder overlaps with the pages/api what nextauth looks for |
Beta Was this translation helpful? Give feedback.
-
cant rewrites be used for this? |
Beta Was this translation helpful? Give feedback.
Unfortunately the
/api
route name is not changeable currently.Depending on your proxy setup, you could "whitelist" the API routes associated with Next while your other API handles the other routes.