nuxt-open-fetch icon indicating copy to clipboard operation
nuxt-open-fetch copied to clipboard

Dynamic base URL

Open jonkri opened this issue 1 year ago • 0 comments

Describe the feature

Using Nuxt 2, I'm configuring the base URL dynamically based on both process.client and process.env.NODE_ENV like so:

$axios.defaults.baseURL = process.client
  ? process.env.NODE_ENV === 'production'
    ? 'https://...'
    : 'http://...'
  : process.env.NODE_ENV === 'production'
  ? 'http://...'
  : 'https://...'

I would like to be able to do this (presumably with import.meta.server instead of process.client) using NuxtOpenFetch and Nuxt 3.

Thanks for a great library!

Additional information

  • [ ] Would you be willing to help implement this feature?

Final checks

jonkri avatar Aug 10 '24 15:08 jonkri