{{ JSON.stringify(data, undefined, 2) }}+ +``` + +> ℹ️ You can connect as many APIs as you want, just add them to the `endpoints` object. + ### Runtime Config Instead of the `apiParty` module option, you can also use the [runtime config](https://nuxt.com/docs/api/configuration/nuxt-config#runtimeconfig) to set your API endpoints: @@ -95,10 +113,8 @@ NUXT_API_PARTY_ENDPOINTS_JSON_PLACEHOLDER_TOKEN= export default defineNuxtConfig({ modules: ['nuxt-api-party'], - runtimeConfig: { - apiParty: { - name: 'json-placeholder' - } + apiParty: { + name: 'jsonPlaceholder' } }) ``` @@ -111,67 +127,6 @@ API_PARTY_BASE_URL=https://jsonplaceholder.typicode.com # API_PARTY_TOKEN=test ``` -Finally, fetch data from your API in your template: - -```vue - - - -
{{ JSON.stringify(data, undefined, 2) }}-