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

Commit 93297e5

Browse files
authored
fix(axios): avoid hard-coded base URL localhost:3000, fixes #641 (#830)
1 parent b5b2050 commit 93297e5

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

packages/cna-template/template/nuxt/nuxt.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@
137137
<%_ if (axios) { _%>
138138

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

packages/create-nuxt-app/test/snapshots/index.test.js.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,10 @@ Generated by [AVA](https://avajs.dev).
17751775
],␊
17761776
17771777
// Axios module configuration: https://go.nuxtjs.dev/config-axios␊
1778-
axios: {},␊
1778+
axios: {␊
1779+
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308␊
1780+
baseURL: '/',␊
1781+
},␊
17791782
17801783
// PWA module configuration: https://go.nuxtjs.dev/pwa␊
17811784
pwa: {␊
@@ -1870,7 +1873,10 @@ Generated by [AVA](https://avajs.dev).
18701873
],␊
18711874
18721875
// Axios module configuration: https://go.nuxtjs.dev/config-axios␊
1873-
axios: {},␊
1876+
axios: {␊
1877+
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308␊
1878+
baseURL: '/',␊
1879+
},␊
18741880
18751881
// Build Configuration: https://go.nuxtjs.dev/config-build␊
18761882
build: {␊
Binary file not shown.

0 commit comments

Comments
 (0)