Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Is axios a consumer of a backend or is it the backend for next? #43

Closed
rlam3 opened this issue Oct 9, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@rlam3
Copy link

commented Oct 9, 2017

Is axios a consumer of a backend or is it the backend for next?
I'm confused... Thanks!

This question is available on Nuxt.js community (#c40)
@pi0

This comment has been minimized.

Copy link
Member

commented Oct 9, 2017

Hi. Actually axios "makes requests" to the backend.

@rlam3

This comment has been minimized.

Copy link
Author

commented Oct 10, 2017

@pi0 Thanks! Was wondering if there was a full example axios-module with nuxtjs repo. If you do, I'd love to get a glimps of how to structure my nuxt app.

Also for the documentation... there is come conflict between nuxt documentation and this readme.md

https://nuxtjs.org/guide/plugins#external-packages

Why does one use vendor, and the other

{
  modules: [
    '@nuxtjs/axios',
  ],

  axios: {
    // proxyHeaders: false
  }
}
@clarkdo

This comment has been minimized.

Copy link

commented Oct 29, 2017

vendor is for adding libs into vendor bundle, external-packages doc showed how to use external packages, , axios is just a example.

axios-module is for easier to construct a axios instance which includes some specific configs and interceptors, you can also use vendor together with module to add axios into vendor bundle:

{
  modules: [
    '@nuxtjs/axios',
  ],

  axios: {
    // proxyHeaders: false
  },

  build: {
    vendor: ['axios']
  },
}
@rlam3

This comment has been minimized.

Copy link
Author

commented Oct 30, 2017

@clarkdo @pi0 is there a more modular way of configuring nuxt applications? nuxt.config.js seems to be just one big file. any way to separate production/development/staging configurations? Thanks.

@clarkdo

This comment has been minimized.

Copy link

commented Oct 31, 2017

nuxt command supports --config-file or -c to specify the path to nuxt.config.js file.
you can define different config files in different npm scripts or use dotenv to load specific environment variables

@pi0 pi0 closed this Jan 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.