Ajout env pour le proxy
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
import {fileURLToPath, URL} from "url";
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
const env = loadEnv(
|
||||
'all',
|
||||
process.cwd(),
|
||||
);
|
||||
const mainTarget = (typeof env.VITE_GULLIVERSHIP_URL !== 'undefined')
|
||||
? env.VITE_GULLIVERSHIP_URL
|
||||
: 'https://gta-pprod.parapharmacie-et-medicament.com/'; // par défaut, on va sur la preprod de PPM
|
||||
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
@@ -13,11 +22,15 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/App': {
|
||||
target: 'https://gta-pprod.parapharmacie-et-medicament.com/',
|
||||
target: mainTarget,
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/interface': {
|
||||
target: 'https://gta-pprod.parapharmacie-et-medicament.com/',
|
||||
target: mainTarget,
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/Php': {
|
||||
target: mainTarget,
|
||||
changeOrigin: true,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user