-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: drop support for single API endpoint
- Loading branch information
1 parent
e49f06b
commit 6b2aa4f
Showing
10 changed files
with
97 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Migration | ||
|
||
## v0.10.0 | ||
|
||
Support for the single API endpoint has been removed to keep the module simple and focused. Migration is fairly straightforward by moving your API configuration into the `endpoints` object: | ||
|
||
```diff | ||
export default defineNuxtConfig({ | ||
apiParty: { | ||
- name: 'myApi', | ||
- url: '<your-api-url>', | ||
- token: '<your-api-token>', | ||
- query: {}, | ||
- headers: {}, | ||
+ endpoints: { | ||
+ myApi: { | ||
+ url: '<your-api-url>', | ||
+ token: '<your-api-token>', | ||
+ query: {}, | ||
+ headers: {}, | ||
+ }, | ||
}, | ||
} | ||
}) | ||
``` | ||
|
||
If you previously used the following environment variables in your project's `.env` file: | ||
|
||
```bash | ||
API_PARTY_BASE_URL=your-api-url | ||
# Optionally, add a bearer token | ||
API_PARTY_TOKEN=your-api-token | ||
``` | ||
|
||
You can now reference them in your API configuration: | ||
|
||
```ts | ||
export default defineNuxtConfig({ | ||
apiParty: { | ||
endpoints: { | ||
myApi: { | ||
url: process.env.API_PARTY_BASE_URL!, | ||
token: process.env.API_PARTY_TOKEN!, | ||
}, | ||
}, | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.