File tree Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Original file line number Diff line number Diff line change 11<div align =" center " >
22
3- <h1 >kinka + serializy</h1 >
3+ <h1 >axios + serializy</h1 >
44
55 [ ![ ] ( https://img.shields.io/badge/license-MIT-red.svg )] ( ./LICENSE )
66 [ ![ ] ( https://img.shields.io/npm/v/axios-serializy.svg )] ( https://www.npmjs.com/package/axios-serializy )
2121 # or using yarn
2222 $ yarn add axios-serializy
2323
24- <!-- ## 📚 Usage -->
25-
26- <!-- ```js
27- import kinka from 'kinka'
28- import axiosSerializy from 'axios-serializy'
24+ ## 📚 Usage
2925
26+ ``` js
27+ import axios from ' axios-serializy'
3028
31- const api = kinka.create({
32- baseURL: 'https://your-api.com',
33- middlewares: [
34- axiosSerializy
35- ]
29+ const api = axios .create ({
30+ baseURL: ' https://your-api.com'
3631})
3732
3833// ...
@@ -44,20 +39,17 @@ const { data } = await api.get('/client/1234', {
4439console .log (data) // your serialized client model
4540```
4641
47- Also if you want to serialize error messages from server you need to:
42+ Also if you want to serialize error messages from server you need to call ` axios.setErrorModel(Model) `
43+ Before creating axios instance
4844
4945``` js
46+ axios .setErrorModel (YourPrettifiedErrorModel)
5047
51- const api = kinka.create({
52- baseURL: 'https://your-api.com',
53- middlewares: [
54- axiosSerializy({
55- errorModel: YourPrettifiedErrorModel
56- })
57- ]
48+ const api = axios .create ({
49+ baseURL: ' https://your-api.com'
5850})
5951
60- ``` -->
52+ ```
6153
6254
6355## 📝 License
Original file line number Diff line number Diff line change 22 "name" : " axios-serializy" ,
33 "version" : " 0.0.1" ,
44 "license" : " MIT" ,
5- "description" : " integration kinka with serializy" ,
5+ "description" : " integration axios with serializy" ,
66 "main" : " lib/axios-serializy.js" ,
77 "unpkg" : " dist/axios-serializy.js" ,
88 "module" : " es/axios-serializy.js" ,
You can’t perform that action at this time.
0 commit comments