Server Actions vs API Endpoints
Answered
Standard Chinchilla posted this in #help-forum
Standard ChinchillaOP
Hey, I wanted to understand when I should use Server Actions and when to create an API endpoint. I understand that I could achieve the same thing with both, is this correct? Is there any case where one is better than the other? Even though Server Actions aren't a GET, can I still use them to fetch data... I'm confused about the topic, to be honest.
3 Replies
Anywhere you can use a route handler you can you a a server action. One reason to use a route handler over a server action is when you need to do things in parallel. Server actions just are queue based.
Standard ChinchillaOP
@Jboncz Thanks you!