Open kikyous opened 1 year ago
I'm facing a similar issue. I want only one of my functions to run on the edge, while the rest should be deployed as serverless. However, I couldn't find the configuration to achieve this :/
Multi-target build to combine edge and lambda is planned: https://github.com/unjs/nitro/issues/1158
In the meantime, you can use a monorepo to build nitro app against vercel edge for that specific route and proxy from main app using route rules or directly update .vercel
directory for custom handlers if really need the underlying API.
Thanks for the quick reply, @pi0 :) I have played with the monorepo solution a little bit. I had a Nuxt app and a Nitro app in my monorepo. When I deployed it to Vercel, both Nitro and Nuxt exported their functions into the same path (.vercel/output/functions/__nitro.func/index.mjs). Since Nitro was built first, it was just overwritten by Nuxt serverless functions. Do you have any recommendations to overcome this? Nitro app:
Nuxt App:
Nice try @ugurkellecioglu! Is it possible to share your testing monorepo so i can try it?
@pi0 Yeah, sure: https://github.com/ugurkellecioglu/monorepo_nuxt_nitro
Describe the feature
Like something in next.js, user can specify runtime for a route using a named export
config
. I know there is avercel-edge
preset, but it is project wide.Additional information