File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,6 @@ module.exports = function nuxtAxios (_moduleOptions) {
52
52
/* istanbul ignore if */
53
53
if ( process . env . API_URL ) {
54
54
options . baseURL = process . env . API_URL
55
- } else {
56
- process . env . API_URL = options . baseURL
57
55
}
58
56
59
57
/* istanbul ignore if */
@@ -93,6 +91,9 @@ module.exports = function nuxtAxios (_moduleOptions) {
93
91
] )
94
92
}
95
93
94
+ // Set _AXIOS_BASE_URL_ for dynamic SSR baseURL
95
+ process . env . _AXIOS_BASE_URL_ = options . baseURL
96
+
96
97
/* eslint-disable no-console */
97
98
debug (
98
99
`BaseURL: ${ chalk . green ( options . baseURL ) } (Browser: ${ chalk . green (
Original file line number Diff line number Diff line change @@ -136,8 +136,8 @@ export default (ctx, inject) => {
136
136
const axiosOptions = {
137
137
// baseURL
138
138
baseURL : process . browser
139
- ? ( process . env . API_URL_BROWSER || '<%= options.browserBaseURL %>' )
140
- : ( process . env . API_URL || '<%= options.baseURL %>' ) ,
139
+ ? '<%= options.browserBaseURL %>'
140
+ : ( process . env . _AXIOS_BASE_URL_ || '<%= options.baseURL %>' ) ,
141
141
142
142
// Create fresh objects for all default header scopes
143
143
// Axios creates only one which is shared across SSR requests!
You can’t perform that action at this time.
0 commit comments