goi-web/vite.config.js

34 lines
938 B
JavaScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
const AUTH_BACKEND = 'http://localhost:8080' // auth-service
const CRM_BACKEND = 'http://localhost:8082' // crm-rest-api
const OPR_BACKEND = 'http://localhost:8083' // opr-rest-api
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
proxy: {
// /auth-service/* -> http://localhost:8080/auth-service/*
'/auth-service': {
target: AUTH_BACKEND,
changeOrigin: true,
secure: false,
},
// /crm-rest-api/* -> http://localhost:8081/crm-rest-api/*
'/crm-rest-api': {
target: CRM_BACKEND,
changeOrigin: true,
secure: false,
},
// /opr-rest-api/* -> http://localhost:8083/opr-rest-api/*
'/opr-rest-api': {
target: OPR_BACKEND,
changeOrigin: true,
secure: false,
},
},
},
})