Static GitHub Issues

[711] ssr asyncData

prev: html miss <base> when router.base just only have a slash
next: Routes generation params and redirects

in my page component i have

async asyncData ({ store }) {
  let { data } = await axios.get('//127.0.0.1:4000/api/files')

  store.commit('files/filesAdded', {files: data.files})
},

when i open different route and navigate to this one, files are fetched as the should, but when i open this route directly, i get error

Nuxt.js Error:

Error: connect ECONNREFUSED 127.0.0.1:80
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1081:14)

it is odd, that it tries to connect to port 80, i only use 4000 port for my backend.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c609">#c609</a>)</em></sub></div>