nuxt3 fetch data with different api adress

169 Views Asked by At

I use nuxt3 and i18n and strapi. The strapi is on a subdomain of the same web address. Therefore the the api of server-side should be on localhost and when the language changes the fetch should apply on the client side therefore the api address is subdomain.mysite.com not localhost. According to my studies, this is possible with different methods. I tried and there is no succession.

  1. I my API address to subdomain.mysite.com and write a nitro proxy or a direct routeRules of nuxt(no success).
  2. I should write a method with a variable API address for fetch I should say I would like to have a ssr any help is appreciable.
0

There are 0 best solutions below