Skip to content

Commit

Permalink
📝 improve README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Vinicius Reis <[email protected]>
  • Loading branch information
Vinicius Reis committed Aug 10, 2022
1 parent 5dc22e8 commit 6a8860f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ Simple, typed wrapper of an Axios instance for Nextcloud that automatically send

## Installation

```sh
npm install @nextcloud/axios --save
```
npm i -S @nextcloud/axios

```sh
yarn add @nextcloud/axios
```

## Usage
Expand All @@ -20,3 +24,21 @@ axios.get('nextcloud.com')
```

See https:/axios/axios for details.

### Defining `baseURL`

You are able to define [`baseURL`](https://axios-http.com/docs/config_defaults) to simplify the usage of axios across your app.

```ts
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'

const baseURL = generateUrl('/apps/your_app_id/api')

axios.defaults.baseURL = baseURL
```

References

- [@nextcloud/router](https:/nextcloud/nextcloud-router)
- [Nextcloud App Routing](https://docs.nextcloud.com/server/latest/developer_manual/basics/routing.html)

0 comments on commit 6a8860f

Please sign in to comment.