Shared API Route or Server Functions across projects (OpenAPI?) - no monorepo
Is there a way to effectively share the type definitions of either API routes or server functions so they can be used in other projects? For example, I have a mobile app (Expo) that I'd like to make calls to my TanStack Start app.
4 Replies
foreign-sapphire•7mo ago
I can't find it anywhere in the doc but Tanner announced
createServerFnClient
a while ago.
https://bsky.app/profile/tannerlinsley.com/post/3ldunfdfrp725conscious-sapphireOP•7mo ago
Not sure that would be statically typed. but at least accessible
or maybe there is some magic i'm missing
looks like someone was asking for it tho
foreign-sapphire•7mo ago
Not sure that would be statically typed.Yeah I wondered the same thing, still patiently waiting for upcoming docs.
conscious-sapphireOP•6mo ago
createServerFnClient <-- just saying this to tag this thread
tried wrapping server functions to make some nice OpenAPI.. problem is server functions seem to be part of SSR, so they don't exist always so can't be iterated..
simple testing implementation