-
Hello, I would like to rely fully on this library, but for now I'm using tRPC with such pattern : https://github.com/t3dotgg/server-actions-trpc-examples/tree/main/src/app Resulting in duplicated validation for fields. I would like to keep control over my data and be able to query it using non-js client. Is there any way to easily support API endpoints using this? Can i just call my actions in express endpoints ? |
Beta Was this translation helpful? Give feedback.
Answered by
ScreamZ
May 17, 2024
Replies: 1 comment 1 reply
-
Server Actions are normal functions, so you should be able to call them inside API routes/Express endpoints. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'll give it a try, this way I could get rid of tRPC for now. Will update this post
Note
This is simple as using server action in request handlers of routes.