title: How to set axios as a default prototype for Nuxt.js and append token to the default axios authorization header?
body: <p>In Vue.js simply we can include axios as our deafault prototype for Vue.js and append local storage token to a default axios authorization header in the Vue main.js file .</p>
  <p>As follows:</p>
  <pre class="lang-js prettyprint-override"><code>import Vue from 'vue'
  import App from './App.vue'
  import router from './router'
  import store from './store'
  import axios from 'axios'
  
  Vue.config.productionTip = false
  
  Vue.prototype.$http = axios;
  const token = localStorage.getItem(&quot;token&quot;);
  if(token){
    Vue.prototype.$http.defaults.headers.common['Authorization'] = token;
  }
  
  new Vue({
    router,
    store,
    render: h =&gt; h(App),
  }).$mount('#app')
  </code></pre>
  <p>My question is how to set axios as a default prototype for Nuxt.js and append local storage token to a default axios authorization header inside the <code>Nuxt.config.js</code> File</p>