T
TanStack7mo ago
foreign-sapphire

Iterating Server functions

Is there a clean way to iterate server functions during runtime or startup?
7 Replies
foreign-sapphire
foreign-sapphireOP7mo ago
i want a registry, trying to decide if I should just wrap the create call, or if i can get it internally
adverse-sapphire
adverse-sapphire7mo ago
what exactly do you try to do here?
foreign-sapphire
foreign-sapphireOP7mo ago
Trying to see if i can use that to generate a swagger doc. can make an endpoint, and make a proxy point
adverse-sapphire
adverse-sapphire7mo ago
what would you use the swagger doc for? a server function is not an API route you would not call it from the outside we have a list of server functions internally, this could theoretically be exposed, if the need arises
foreign-sapphire
foreign-sapphireOP7mo ago
that would be what the proxy point handles just an api endpoint that calls the appropriate server function seems like the cleanest way to accomplish my goals for the time being cleaner than tryign to spin up elysiajs or hono or something in the same instance
adverse-sapphire
adverse-sapphire7mo ago
hmm why not use an API route instead?
foreign-sapphire
foreign-sapphireOP7mo ago
1) api routes dont have validation i could grok to make definitions. 2) Tanner said that eventually he'd have server functions do this work. tho i guess thinking about that. i cant query the details of validation on a serverfn, since it just exposes a validation function, not the actual validator.. i might need to make a registry anyhow., if i cant attach additional data could wrap api routes to get input/output definitions as well.. but

Did you find this page helpful?