TanStackT
TanStack8mo ago
2 replies
skinny-azure

Get API URL(link) from server function & API route

Hi team thanks for the awesome stack.

I wonder if there is a typesafe way to get the URL of an api route, e.g. https://mydomain.com/api/thatCallback, from within a server function or API route?

If not, just getting a relative path is also good.

This will be useful for both API route and server function.

Cheers.
Was this page helpful?