Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
emyann committed Nov 15, 2018
1 parent 07f2461 commit dfde525
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ npm install --save axios-morphism
### Example

```typescript
import axios from "axios";
import { apply, AxiosMorphismConfiguration } from './axios-morphism';

const peopleSchema = {
Expand All @@ -23,7 +24,8 @@ const peopleSchema = {
const configuration: AxiosMorphismConfiguration = {
url: 'https://swapi.co/api/',
interceptors: {
responses: [{ matcher: '/people/:id', schema: peopleSchema }]
responses: [{ matcher: '/people/:id', schema: peopleSchema }],
requests: []
}
};

Expand All @@ -33,7 +35,9 @@ apply(client, configuration);
await client.get('/people/1');
// {
// name: 'Luke Skywalker'
// name: "Luke Skywalker"
// height: "172"
// weight: "77"
// }
```

Expand Down

0 comments on commit dfde525

Please sign in to comment.