Skip to content

Report a problem:

Problems can be reported via Microsoft Teams in your team channel within the "IT - Codey" team.

Please include the following information:

Report type:
Docs problem report a bug instead →
Path:
/latest/packages/nuxt-utils/axios-plugin.html
Message:

DESCRIBE THE PROBLEM BEFORE SUBMITTING TO CODEY

Axios base url plugin

In order for HTTP calls to work on the different environments (local, BFF, deployment URL), a plugin is available for Nuxt. This plugin will make sure that the right base URL is always set in the application. This can be done by checking the URL of the browser.

TIP

Credits to Tai Thien for providing us with this plugin.

First we need to include it in the nuxt config:

javascript
//nuxt.config.js
plugins: [
    './node_modules/@xerius/codey-nuxt-utils/build/plugins/axios-base-url.js',
],

The plugin depends on routing variables to be available within Nuxt, these need to be set in the publicRuntimeConfig:

javascript
//nuxt.config.js
publicRuntimeConfig: {
  ...routing.getRoutingRuntimeConfig(),
},

Report a problem:

Problems can be reported via Microsoft Teams in your team channel within the "IT - Codey" team.

Please include the following information:

Report type:
Docs problem report a bug instead →
Path:
/latest/packages/nuxt-utils/axios-plugin.html
Message:

DESCRIBE THE PROBLEM BEFORE SUBMITTING TO CODEY

Last updated: