Skip to content

EventService axios instance #10

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
davestewart opened this issue Apr 24, 2021 · 0 comments
Open

EventService axios instance #10

davestewart opened this issue Apr 24, 2021 · 0 comments

Comments

@davestewart
Copy link

davestewart commented Apr 24, 2021

In lesson 8, Greg creates a new Axios instance:

import axios from 'axios'
    
const apiClient = axios.create({
  baseURL: `http://localhost:3000`,
  withCredentials: false,
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json'
  }
})

However, in lesson 6 we already installed and configured the Nuxt Axios module which "gives you a bunch of additional features out of the box":

nuxt.config.js
module.exports = {
  modules: [
    '@nuxtjs/axios',
  ]
}

Seeing as we are not using this module in the service, I presume we don't get these benefits, or any of the configuration benefits?

Could we use the original Nuxt instance / is there even a way to use this, so:

import client from `...`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant