title: Different baseURL for server and client API calls with axios & nuxt
body: <p>Let's say I'm developing a platform with multi micro-services, and Nuxt frontend service is one of them.
  I'm using Axios inside a nuxt middleware (which is running in both server and client).
  inside the nuxt service, the API baseURL is an internal call in local machine, but from client-side, the baseURL is the public app domain off course.</p>
  
  <p>I can solve it using the server's request object, or config files, or to distinguish the run environment.
  Every option i mentioned can work, but right now I'm looking for a best practice for different client vs. server environment variables.</p>
  
  <p>the middleware file:</p>
  
  <pre><code>import axios from 'axios'
  
  export default function ({ route }) {
    return axios.get('api/some-data');
  }
  </code></pre>
  
  <p>request from server should call to "<a href="http://internal-service:SOME_PORT/api/some-data" rel="nofollow noreferrer">http://internal-service:SOME_PORT/api/some-data</a>.</p>
  
  <p>request from client should call to "<a href="http://my-domain.com/api/some-data" rel="nofollow noreferrer">http://my-domain.com/api/some-data</a>.</p>