Server Route Search Params
Is there a proper way to implement search params in server routes? I'm struggling to figure this out, since 'search' isn't available at all in the GET function parameters, and validateSearch is seemingly meaningless for server routes.
For my main app, I'm using server functions in my SSR/queryClient fetching rather than fetching from the API like a conventional backend. But, eventually, having an external API would be important for my users.
I suppose it's feasible to do something like this, but it feels like circumventing Start.
4 Replies
rare-sapphire•4d ago
you need to parse the search params from the URL
start's server routes are purely request/response
parsing the search can be done in many ways, you can also think about nesting something like hono inside of start
sunny-green•3d ago
@Manuel Schiller so the
validateSearch
is truly meaningless for server routes?rare-sapphire•3d ago
for the server part, yes
but you can have server route and normal render route in the same file
sunny-green•2d ago
Gotcha thank you