Closed OrJDev closed 10 months ago
This would have to be more thought out because we probably want on way of doing route level config (for pages, and API routes).
It needs to be able to do a few things:
Something to note for config... this is very adapter specific as the concept of edge doesn't exist for node. its not the best example as most others do but their could be config for region names
In setting up for SolidStarts next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed by mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience. See https://github.com/solidjs/solid-start/pull/1139 for more details.
Enhancement
Allow
config
export within api route, this is similar toNextJS
v13 config exports.Why
Assuming you have a
solid-start
app that includes api routes that cannot run inedge
environment, and one single api route that can and should be running on verceledge
, how would you do that?Currently when using the vercel adapter you have to say wether you do or don't want to use the vercel edge:
false
you won't be able to run stuff on edge at all.true
and you have some api routes that cannot run on the edge - you won't be able to build the project at all (an error will be thrown)How does it look like
In NextJS you can export a
config
object that mentions the runtime environment (edge, etc) - this should be exported from a single api route (api/test.ts for instance)Using the above code will make this api route run in edge environment, by default it should target to non edge environments (meaning that it will be treated as serverless function if the config is not mentioned)