Merge pull request '#2 fix(Environment): move django url to vite.config.mjs' (#4) from fix_api_implementantion_env_#2 into main

Reviewed-on: #4
This commit is contained in:
mono 2025-03-02 00:45:31 -05:00
commit 4e88477323
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
class DjangoApi {
constructor() {
this.base = 'http://localhost:7000';
this.base = process.env.DJANGO_BASE_URL;
}
getCustomers() {

View File

@ -46,7 +46,10 @@ export default defineConfig({
vueTemplate: true,
}),
],
define: { 'process.env': {API_IMPLEMENTATION: 'django'} },
define: { 'process.env': {
API_IMPLEMENTATION: 'django',
DJANGO_BASE_URL: 'http://localhost:7000'
} },
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))