1.0.2 • Published 7 years ago
api-requests-nuxt v1.0.2
Nuxt module for api-requests
Setup
- Add 
api-requests-nuxtdependency to your project - Add 
api-requests-nuxttomodulessection ofnuxt.config.js - Add 
@nuxtjs/axiosdependency to your project and tomodulessection ofnuxt.config.js 
WARNING: it's important to add @nuxtjs/axios after api-requests-nuxt!
{
  modules: [
    ['api-requests-nuxt', {
      apiDirectory: path.resolve(__dirname, 'api'),
      debug: true, // default is false
      injectKey: 'request', // default is 'api'
    }],
    '@nuxtjs/axios'
 ]
}Usage
You can use api-requests by calling this.$api[REQUEST_NAME](REQUEST_PARAMS) in Vue object or Vuex actions.
Set debug option to false to disable logging of successful requests.
Set injectKey option to request, for example, to call api-request with this.$request instead of this.$api.
License
Copyright (c) Bitch Intelligence we@bitch.team (https://bitch.team/)
1.0.2
7 years ago