From c74aa2e65e43817f7038c799b373ccdf4d4cd88a Mon Sep 17 00:00:00 2001 From: antoninbeaufort <33757018+AntoninBeaufort@users.noreply.github.com> Date: Wed, 23 Feb 2022 13:21:51 +0100 Subject: [PATCH] fix links --- docs/pages/en/1.getting-started/1.setup.md | 4 +-- docs/pages/en/1.getting-started/2.usage.md | 2 +- .../en/1.getting-started/3.http-methods.md | 34 +++++++++---------- docs/pages/en/1.getting-started/4.advanced.md | 2 +- docs/pages/en/1.index.md | 4 +-- docs/pages/en/2.API/1.options.md | 2 +- docs/pages/en/2.API/3.helpers.md | 6 ++-- docs/pages/en/2.API/4.hooks.md | 6 ++-- .../en/3.migration-guides/1.migration.md | 6 ++-- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/docs/pages/en/1.getting-started/1.setup.md b/docs/pages/en/1.getting-started/1.setup.md index 13200f0..1de7976 100644 --- a/docs/pages/en/1.getting-started/1.setup.md +++ b/docs/pages/en/1.getting-started/1.setup.md @@ -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 @@ -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)) diff --git a/docs/pages/en/1.getting-started/2.usage.md b/docs/pages/en/1.getting-started/2.usage.md index 3d32ec8..e673630 100644 --- a/docs/pages/en/1.getting-started/2.usage.md +++ b/docs/pages/en/1.getting-started/2.usage.md @@ -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. diff --git a/docs/pages/en/1.getting-started/3.http-methods.md b/docs/pages/en/1.getting-started/3.http-methods.md index 9c1c845..6c75967 100644 --- a/docs/pages/en/1.getting-started/3.http-methods.md +++ b/docs/pages/en/1.getting-started/3.http-methods.md @@ -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` @@ -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` @@ -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` @@ -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` @@ -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` @@ -121,7 +121,7 @@ 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` @@ -129,7 +129,7 @@ const data = await $http.$patch('http://api.com/{id}', { foo: 'bar' }, { - 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` @@ -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. @@ -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` @@ -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. @@ -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` @@ -204,7 +204,7 @@ 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. @@ -212,7 +212,7 @@ These methods corresponds to the similar named HTTP/1.1 methods. - 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` @@ -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. @@ -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` @@ -259,7 +259,7 @@ 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. @@ -267,7 +267,7 @@ These methods corresponds to the similar named HTTP/1.1 methods. - 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` diff --git a/docs/pages/en/1.getting-started/4.advanced.md b/docs/pages/en/1.getting-started/4.advanced.md index 2d03ab6..1cb336b 100644 --- a/docs/pages/en/1.getting-started/4.advanced.md +++ b/docs/pages/en/1.getting-started/4.advanced.md @@ -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. diff --git a/docs/pages/en/1.index.md b/docs/pages/en/1.index.md index 264e181..f505694 100644 --- a/docs/pages/en/1.index.md +++ b/docs/pages/en/1.index.md @@ -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. @@ -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) diff --git a/docs/pages/en/2.API/1.options.md b/docs/pages/en/2.API/1.options.md index a2ef814..f2c78b9 100644 --- a/docs/pages/en/2.API/1.options.md +++ b/docs/pages/en/2.API/1.options.md @@ -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` diff --git a/docs/pages/en/2.API/3.helpers.md b/docs/pages/en/2.API/3.helpers.md index cfab9dd..cf736fe 100644 --- a/docs/pages/en/2.API/3.helpers.md +++ b/docs/pages/en/2.API/3.helpers.md @@ -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` @@ -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. diff --git a/docs/pages/en/2.API/4.hooks.md b/docs/pages/en/2.API/4.hooks.md index 8451b4d..f71272f 100644 --- a/docs/pages/en/2.API/4.hooks.md +++ b/docs/pages/en/2.API/4.hooks.md @@ -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` @@ -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` @@ -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. diff --git a/docs/pages/en/3.migration-guides/1.migration.md b/docs/pages/en/3.migration-guides/1.migration.md index 7ff0674..380ad9b 100644 --- a/docs/pages/en/3.migration-guides/1.migration.md +++ b/docs/pages/en/3.migration-guides/1.migration.md @@ -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)
+- There is no scope for [`setHeader`](/api/helpers#setheader), [`setToken`](/api/helpers#settoken)
_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
-_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
-_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)
_This option may be added again once [`PR #105 : progress bar`](https://github.com/nuxt/http/pull/105) is merged_