File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export const useApiStore = defineStore('api', () => {
8686 // Use explicit string check because the env var might be a string "true" or "false"
8787 // thanks to the defines in vite.config.ts
8888 const isDemo = import . meta. env . VITE_IS_DEMO === 'true' ;
89- const url = isDemo ? '/ sample.json' : `${ apiHost . value } /docs-api/routes` ;
89+ const url = isDemo ? `/ ${ import . meta . env . PUBLIC_BASE } / sample.json` : `${ apiHost . value } /docs-api/routes` ;
9090 const response = await fetch ( url ) ;
9191 if ( ! response . ok ) throw new Error ( `HTTP error! status: ${ response . status } ` ) ;
9292 const data = await response . json ( ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ export default defineConfig({
88 vue ( ) ,
99 ] ,
1010 define : {
11- 'import.meta.env.VITE_IS_DEMO' : JSON . stringify ( process . env . VITE_IS_DEMO )
11+ 'import.meta.env.VITE_IS_DEMO' : JSON . stringify ( process . env . VITE_IS_DEMO ) ,
12+ 'import.meta.env.PUBLIC_BASE' : JSON . stringify ( process . env . PUBLIC_BASE )
1213 } ,
1314 resolve : {
1415 alias : {
You can’t perform that action at this time.
0 commit comments