How to use multiple runtimes for serverless functions WITHOUT breaking local dev #9840
Replies: 2 comments 2 replies
-
+1 same issue I'm running into at the moment. I want to have Deploying to Vercel isn't an issue - they both run there, but local development doesn't allow it. |
Beta Was this translation helpful? Give feedback.
-
How do you run your project locally? I have a project with both Edge functions and Python endpoints. I run it using the |
Beta Was this translation helpful? Give feedback.
-
Description
I'm interested in including a mix of Python + Nextjs/node-based functions in my deployed API. I've seen #6197, which suggests that I should move all the functions (JS and python) into a
/api
folder at the root of my project, at which point vercel will automatically deploy each function in an appropriate runtime based on its file extension.However it seems Nextjs itself has a hardcoded assumption that api files are defined at
/pages/api
(or/src/pages/api
). This means that while my app now works when deployed by Vercel, it breaks on local development. I tried keeping both a/pages/api
and/api
folder but it seems that's not recommended either.Any idea how I can prevent local dev from breaking?
Beta Was this translation helpful? Give feedback.
All reactions