axios-endpoint
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "axios-endpoint", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Scalable and easy to use axios arch", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1,1 +0,46 @@ | ||
## Axios endpoint | ||
## Axios endpoint | ||
Manage and create axios requests without a hassle | ||
### Installation | ||
```bash | ||
npm i axios-endpoint | ||
``` | ||
### Usage | ||
#### Import it | ||
```javascript | ||
let route = require('axios-endpoint') | ||
``` | ||
##### or ES6 | ||
```javascript | ||
import route from 'axios-endpoint' | ||
``` | ||
#### Configure axios as you like | ||
```javascript | ||
const axios = require('axios') | ||
axios.defaults.baseURL = 'https://jsonplaceholder.typicode.com'; | ||
``` | ||
#### Use it | ||
```javascript | ||
let endpoint = { | ||
getTodos: route('GET','/todos/').generate(), | ||
} | ||
endpoint.getTodos().then(response => { | ||
console.log(response) | ||
}).catch(error => { | ||
console.error(error) | ||
}) | ||
``` | ||
### Run tests | ||
```bash | ||
npm run test | ||
``` |
2225
46