Skip to content

[Docs] Fix links #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/pages/en/1.getting-started/1.setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
```

:::alert{type="success"}
That's it! You can now use [$http](/usage) in your Nuxt app ✨
That's it! You can now use [$http](/getting-started/usage) in your Nuxt app ✨
:::

## Configure
Expand All @@ -54,7 +54,7 @@ export default {
}
```

See [http's options](/API/options).
See [http's options](/api/options).

:::alert{type="warning"}
Note that this module does not currently support IE 11 because of using [ky](https://github.com/sindresorhus/ky) ([open issue](https://github.com/nuxt/http/issues/126))
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/en/1.getting-started/2.usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: 'How to use this module'

## Making Requests

See the list of [available HTTP methods](/http-methods).
See the list of [available HTTP methods](/getting-started/http-methods).

Calling a HTTP methods returns a `Promise` that resolves to a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) object or rejects in case of network errors.

Expand Down
34 changes: 17 additions & 17 deletions docs/pages/en/1.getting-started/3.http-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Each http method returns a `Promise`

- arguments: `(url, options?)`
- url: `String`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [JSON](https://developer.mozilla.org/en-US/docs/Web/API/Body/json) if [destr](https://github.com/nuxt-contrib/destr) can convert automatically, otherwise fallback to String
- rejects: `Error`

Expand All @@ -31,7 +31,7 @@ const items = await $http.$get('items', { prefixUrl: 'https://example.com' })
- arguments: `(url, body?, options?)`
- url: `String`
- body: `Object`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [JSON](https://developer.mozilla.org/en-US/docs/Web/API/Body/json) if [destr](https://github.com/nuxt-contrib/destr) can convert automatically, otherwise fallback to String
- rejects: `Error`

Expand All @@ -55,7 +55,7 @@ const data = await $http.$post('http://api.com', { foo: 'bar' }, {
- arguments: `(url, body?, options?)`
- url: `String`
- body: `Object`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [JSON](https://developer.mozilla.org/en-US/docs/Web/API/Body/json) if [destr](https://github.com/nuxt-contrib/destr) can convert automatically, otherwise fallback to String
- rejects: `Error`

Expand All @@ -76,7 +76,7 @@ const data = await $http.$put('http://api.com/{id}', { foo: 'bar' }, {

- arguments: `(url, options?)`
- url: `String`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [JSON](https://developer.mozilla.org/en-US/docs/Web/API/Body/json) if [destr](https://github.com/nuxt-contrib/destr) can convert automatically, otherwise fallback to String
- rejects: `Error`

Expand All @@ -99,7 +99,7 @@ const jsonResponse = await $http.$delete('item/{id}', {
- arguments: `(url, body?, options?)`
- url: `String`
- body: `Object`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [JSON](https://developer.mozilla.org/en-US/docs/Web/API/Body/json) if [destr](https://github.com/nuxt-contrib/destr) can convert automatically, otherwise fallback to String
- rejects: `Error`

Expand All @@ -121,15 +121,15 @@ const data = await $http.$patch('http://api.com/{id}', { foo: 'bar' }, {

- arguments: `(url, options?)`
- url: `String`
- options: [options](/options)
- options: [options](/api/options)
- resolves: -
- rejects: `Error`

### `get`

- arguments: `(url, options?)`
- url: `String`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
- rejects: `Error`

Expand All @@ -146,7 +146,7 @@ const response = await $http.get('items', { prefixUrl: 'https://example.com' })
const textResponse = await response.text()
```

See [`here`](/usage#making-requests) to convert response stream into usable data.
See [`here`](/getting-started/usage#making-requests) to convert response stream into usable data.

These methods corresponds to the similar named HTTP/1.1 methods.

Expand All @@ -155,7 +155,7 @@ These methods corresponds to the similar named HTTP/1.1 methods.
- arguments: `(url, body?, options?)`
- url: `String`
- body: `Object`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
- rejects: `Error`

Expand All @@ -176,7 +176,7 @@ const response = await $http.post('http://api.com', { foo: 'bar' }, {
const jsonResponse = await response.json()
```

See [`here`](/usage#making-requests) to convert response stream into usable data.
See [`here`](/getting-started/usage#making-requests) to convert response stream into usable data.

These methods corresponds to the similar named HTTP/1.1 methods.

Expand All @@ -185,7 +185,7 @@ These methods corresponds to the similar named HTTP/1.1 methods.
- arguments: `(url, body?, options?)`
- url: `String`
- body: `Object`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
- rejects: `Error`

Expand All @@ -204,15 +204,15 @@ const response = await $http.put('http://api.com/{id}', { foo: 'bar' }, {
const jsonResponse = await response.json()
```

See [`here`](/usage#making-requests) to convert response stream into usable data.
See [`here`](/getting-started/usage#making-requests) to convert response stream into usable data.

These methods corresponds to the similar named HTTP/1.1 methods.

### `delete`

- arguments: `(url, options?)`
- url: `String`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
- rejects: `Error`

Expand All @@ -230,7 +230,7 @@ const response = await $http.delete('item/{id}', {
})
```

See [`here`](/usage#making-requests) to convert response stream into usable data.
See [`here`](/getting-started/usage#making-requests) to convert response stream into usable data.

These methods corresponds to the similar named HTTP/1.1 methods.

Expand All @@ -239,7 +239,7 @@ These methods corresponds to the similar named HTTP/1.1 methods.
- arguments: `(url, body?, options?)`
- url: `String`
- body: `Object`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
- rejects: `Error`

Expand All @@ -259,15 +259,15 @@ const response = await $http.patch('http://api.com/{id}', { foo: 'bar' }, {
const jsonResponse = await response.json()
```

See [`here`](/usage#making-requests) to convert response stream into usable data.
See [`here`](/getting-started/usage#making-requests) to convert response stream into usable data.

These methods corresponds to the similar named HTTP/1.1 methods.

### `head`

- arguments: `(url, options?)`
- url: `String`
- options: [options](/options)
- options: [options](/api/options)
- resolves: [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
- rejects: `Error`

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/en/1.getting-started/4.advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: 'Advanced concepts'

Hooks can be used to globally intercept HTTP request and responses. E.g. if you wish to log errors, display a toast on error or need to dynamically modify requests.

See the [API reference](/hooks) for the list of lifecycle hooks the HTTP module provides
See the [API reference](/api/hooks) for the list of lifecycle hooks the HTTP module provides

These functions don't have to return anything by default.

Expand Down
4 changes: 2 additions & 2 deletions docs/pages/en/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'HTTP module for Nuxt.js provides a universal way to make HTTP requ

The HTTP module for [Nuxt](https://nuxtjs.org) provides a universal way to make HTTP requests to any API.

It uses [ky-universal](https://github.com/sindresorhus/ky-universal) and [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make HTTP requests. Please see the [migration guide](./migration) if you are currently using axios module and wish to migrate.
It uses [ky-universal](https://github.com/sindresorhus/ky-universal) and [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make HTTP requests. Please see the [migration guide](/migration-guides/migration) if you are currently using axios module and wish to migrate.

Starting from [v2.5.0](https://github.com/nuxt/nuxt.js/releases/tag/v2.5.0), Nuxt.js has built-in support for universal fetch. However, this module provides several advantages.

Expand All @@ -30,4 +30,4 @@ Starting from [v2.5.0](https://github.com/nuxt/nuxt.js/releases/tag/v2.5.0), Nux
## Links

* [ky](https://github.com/sindresorhus/ky)
* [`BaseURL`](/options#baseurl)
* [`BaseURL`](/api/options#baseurl)
2 changes: 1 addition & 1 deletion docs/pages/en/2.API/1.options.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Base URL which is used and prepended to make requests in server side.
Environment variable `API_URL` can be used to **override** `baseURL`.

:::alert{type="info"}
`baseURL` and `proxy` won't work together, you will need to use [`prefix`](/options#prefix) instead
`baseURL` and `proxy` won't work together, you will need to use [`prefix`](#prefix) instead
:::

## `browserBaseURL`
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/en/2.API/3.helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Globally set a header to all subsequent requests
this.$http.setHeader('Content-Type', 'application/json')
```

See [here](/advanced#header-helpers) for usage.
See [here](/getting-started/advanced#header-helpers) for usage.

## `setToken`

Expand All @@ -63,10 +63,10 @@ Globally set a `Authorization` header for all subsequent requests.
this.$http.setToken('123', 'Bearer')
```

See [here](/advanced#settokentoken-type) for usage.
See [here](/getting-started/advanced#settokentoken-type) for usage.

## `create`

- arguments: `(kyOptions)`

Create a new KY instance based on defaults, see [create new instance based on defaults](/advanced#create-new-instance-based-on-defaults) for usage.
Create a new KY instance based on defaults, see [create new instance based on defaults](/getting-started/advanced#create-new-instance-based-on-defaults) for usage.
6 changes: 3 additions & 3 deletions docs/pages/en/2.API/4.hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ({ $http }) {
}
```

See [here](/advanced#hooks) for advanced usage.
See [here](/getting-started/advanced#hooks) for advanced usage.

## `onResponse`

Expand All @@ -37,7 +37,7 @@ export default function ({ $http }) {
}
```

See [here](/advanced#hooks) for advanced usage.
See [here](/getting-started/advanced#hooks) for advanced usage.

## `onError`

Expand Down Expand Up @@ -65,4 +65,4 @@ Available properties:

You can optionally return a value or promise that can resolve for fallback response. If hook returns any value, other hooks **won't** be called.

See [here](/advanced#hooks) for advanced usage.
See [here](/getting-started/advanced#hooks) for advanced usage.
6 changes: 3 additions & 3 deletions docs/pages/en/3.migration-guides/1.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ The nuxt-community axios module is still supported and maintained. The HTTP modu

## Differences

- There is no scope for [`setHeader`](/helpers#setheader), [`setToken`](/helpers#settoken)<br/>
- There is no scope for [`setHeader`](/api/helpers#setheader), [`setToken`](/api/helpers#settoken)<br/>
_When calling these methods they apply to the global scope and are used for all future requests_
- The axios hooks `onRequestError` and `onResponseError` are unified<br/>
_Use the [`onError`](/hooks#onerror) hook instead_
_Use the [`onError`](/api/hooks#onerror) hook instead_
- The http module does not have a `debug` option like the axios module<br/>
_You can setup a basic logger using the [`onRequest`](/hooks#onrequest) hook_
_You can setup a basic logger using the [`onRequest`](/api/hooks#onrequest) hook_
- Progress bar integration is not supported (for the moment)<br/>
_This option may be added again once [`PR #105 : progress bar`](https://github.com/nuxt/http/pull/105) is merged_

Expand Down