Ability to perform a tRPC request form a terminal, curl-like

AAutomationD5/11/2023
Hey, I wanted to ask if there is conventional a way to do that? I wanted to warmup my lambda but can't find a dead-simple way to stick this into a cron. TY!
Nnlucas5/11/2023
What are you trying to achieve?
Nnlucas5/11/2023
My API has a warmup endpoint which the frontend calls on page open before any bigger calls are required, so the UI can present a warmup spinner

If you want your API perpetually warm though, lambda has a provisioned capacity you can set to do this
AAutomationD5/11/2023
Hey Nick, I want to call a tRCP endpoint to warm it up. It's on Vercel, let's say. I want this function to be always warm there, so have a cron job to call it ever x minutes

I see what you mean with the warmup on the frontend side, it could work yeah.
Nnlucas5/11/2023
In general, best to let it scale to 0 if there's no dedicated capacity controls
Nnlucas5/11/2023
Focus on optimising cold boots in my opinion
Nnlucas5/11/2023
But you could could the tRPC client with a little node.js script to hit a healthcheck endpoint if you like
AAutomationD5/11/2023
I think I'll just curl the /<route>.<query>?batch&input&from 🤔

It seems to work
Nnlucas5/11/2023
Yeah doesn't even have to be a valid URL probably!
Nnlucas5/11/2023
With the way serverless creates new instances during surges in loads, you're probably not going to avoid cold boots is all. The first few users might benefit but everyone else will eventually get a slow response
AAutomationD5/11/2023
public endpoint seems to works fine with a regular curl, at least locally
AAutomationD5/11/2023
With the way serverless creates new instances during surges in loads, you're probably not going to avoid cold boots is all. The first few users might benefit but everyone else will eventually get a slow response
That's true. Unless I know how many users I need and pre-scale it that way.
Nnlucas5/11/2023
At this point just move off Vercel haha
AAutomationD5/11/2023
yeah
AAutomationD5/11/2023
What I want at this stage is that those 5 users hitting my app to be happy hehe
AAutomationD5/11/2023
so the answer would be to run a get request towards an endpoint in a right format
Nnlucas5/11/2023
I've heard good noises around this for people who find serverless isn't right for them but want simple

https://www.flightcontrol.dev/
AAutomationD5/11/2023
Thank you!

I don't mind running my own k8s cluster, I'm from OPS. What I want is to bridge the gap between Vercel and AWS, and for now I'm solving the Vercel part, since a lot of people start using it and getting thrown away by cold starts
AAutomationD5/11/2023
TBH, I don't like super hard wrappers like this around cloud. They create some "false control percepton" I could be wrong though hehe
AAutomationD5/11/2023
Thanks again Nick
AAutomationD5/11/2023
I'll probably continue asking stupid questions on this discord 😂