A simple way to query your REST or your GraphQL API in your Vue.js app
npm install --save vue-apitator
or
yarn add vue-apitator
in your main.js:
import Apitator from 'apitator'
Vue.use(Apitator, {
baseUrl: 'https://example.com/api'
})
in your vue component:
this.$apitator.get('/users').then(response => {
console.log(response.data)
})
Test with jest, execute with:
npm run test
or, to watch:
npm run test-watch
You can contribute to apitator by forking this repository and pull request your changes. This lib is written in typescript, you can use npm run dev
to start adding features!
If you have any problems with this library, feel free to create an issue!