Ajout env pour le proxy

This commit is contained in:
2024-07-01 17:50:58 +02:00
parent 1441ba1e56
commit 1d8206f19e
3 changed files with 23 additions and 5 deletions

View File

@@ -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,
}
}