Next.js Discord

Discord Forum

Next JS via custom backend

Unanswered
Korat posted this in #help-forum
Open in Discord
KoratOP
Is it good to use next server as a proxy between client and a custom dotnet api.

What i'm doing is using server actions for both fetching and mutating the data (even with react query i pass a server action as queryfn).

Is that normal thing to do and is it going to increase the cost on azure?

3 Replies

KoratOP
Toyger
it's not ideal but still viable, about additional cost it depends what is your site architecture, but overall such way will increase bandwith at least for api calls.
KoratOP
Yeah, i agree because i heard server actions create a post request under the hood.

when people say you shouldnt use server actions to get data, i think they mean for just next apps.

i find it to be normal if i use it to communicate with another api to fetch data.

also in my case theres no way around it cause i need to extract the jwt token from cookies and pass it to my external api as bearer token.

so yeah, i hope the cost wont be too much for the extra api calls because i have no way around it