How to create new tRPC api route calling external api
Hi I have this app where I want to add a new prompt api route in
server/api/routers/prompt.ts
of the generated T3 app with all modules selected on install.
The code I'm trying to run:
after the code above in the prompt.ts
file created I attach it to the root.ts
of the routers - just like with the example.ts
file and proceed to call it in my client like so:
This gives me a 429 tRPC error when called and I unfortunately have no idea and have been everywhere with the documentation available, any of you friendly developers that have an idea?4 Replies
Was my question okay formulated? Or should I try again:)?
So i guess you are calling a protectedProcedure from client side as it is not recommended to do so, you can just make tht createStory as publicProcedure and maybe the problem resolves
Thanks for the input, unfortunately this did not work as much as I'd like it to 😦 Seems like the request get's called a multitude of times after calling the api
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View