Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit

Permalink
fix(axios): avoid hard-coded base URL localhost:3000, fixes #641 (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
scscgit authored Jul 21, 2021
1 parent b5b2050 commit 93297e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/cna-template/template/nuxt/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@
<%_ if (axios) { _%>

// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {},
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: '/',
},
<%_ } _%>
<%_ if (pwa) { _%>

Expand Down
10 changes: 8 additions & 2 deletions packages/create-nuxt-app/test/snapshots/index.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,10 @@ Generated by [AVA](https://avajs.dev).
],␊
// Axios module configuration: https://go.nuxtjs.dev/config-axios␊
axios: {},␊
axios: {␊
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308␊
baseURL: '/',␊
},␊
// PWA module configuration: https://go.nuxtjs.dev/pwa␊
pwa: {␊
Expand Down Expand Up @@ -1870,7 +1873,10 @@ Generated by [AVA](https://avajs.dev).
],␊
// Axios module configuration: https://go.nuxtjs.dev/config-axios␊
axios: {},␊
axios: {␊
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308␊
baseURL: '/',␊
},␊
// Build Configuration: https://go.nuxtjs.dev/config-build␊
build: {␊
Expand Down
Binary file modified packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.

0 comments on commit 93297e5

Please sign in to comment.