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

fix(axios): avoid hard-coded base URL localhost:3000, fixes #641 #830

Merged
merged 1 commit into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.