running vercel edge api functions?

Trying to use vercel edge functions for my trpc api routes. Having a hard time with this. Any advice?
5 Replies
whatplan
whatplan15mo ago
pages or app
Jonathan.Alphonso
Pages router
whatplan
whatplan15mo ago
in your api/trpc/[trpc].ts file add
export const config = {
runtime: 'edge',
}
export const config = {
runtime: 'edge',
}
then as long as your code is not too large or uses node apis you should be set
Jonathan.Alphonso
Is there a way to pick only specific functions to run on edge?
whatplan
whatplan15mo ago
https://discordapp.com/channels/966627436387266600/1130432793189564436/1130432793189564436 everything in your trpc router is a single endpoint, so if you want to split them up you need to add multiple root routers see this thread
Want results from more Discord servers?
Add your server