Access Nuxt Context in utils.js for using localePath nuxt-i18n

Viewed 26

I want to use localePath in baseUrl but nuxt context is not available here. Is there any solution to make it possible. Thanks in Advance

  axios.create({
    baseURL: `${API_DOMAIN}/${localePath}/${apiURL}`,
    headers: requestHeaders(),
    paramsSerializer: (params) => Qs.stringify(params, { arrayFormat: 'brackets' }),
  });

export default client;
0 Answers
Related