Next.js Discord

Discord Forum

Internalization with api address for each locale

Unanswered
Bavarian Mountain Hound posted this in #help-forum
Open in Discord
Bavarian Mountain HoundOP
What is the best way to approach a problem in which we want to, for a given locale, modify the address of the api we are hitting?

I would like to extend such a project with something like this
https://github.com/vercel/commerce

Currently it is simply env while on the basis of locale I would like e.g. this string of api address to modify somehow. The question is where?

https://erichowey.dev/writing/advanced-internationalization-with-nextjs-and-middleware/
I found such an article, in which the api address is edited in the middleware, and that's all right, but what about the requests that do not go this way such as POST and are sending it directly from the client

0 Replies