nuxtjs/axios What is the way to initialize version 4.4.0? (nuxt.js)

Viewed 1678

I would like to use the nuxtjs/axios module.

At first, I install the module with npm

npm install nuxtjs/axios

Then I set the options in the nuxt.config.js file.

modules: [
  ['@ nuxtjs/axios', {
    baseURL: 'http://localhost: 4000',
    browserBaseURL: '/api',
  }],
]

When I start the app with

npm run dev

I expect the below output:

enter image description here

In nuxtjs/axios version 2.1.0, it is built as follows.

enter image description here

[AXIOS] Base URL: http: // localhost: 3000 /, Browser: /

Why can not I see the above message?

I think it might be because of a problem with asyncData () {}.

Also browserBaseURL: '/ api' does not work.

1 Answers
Related