prod için Allowed_Host eklendi.

This commit is contained in:
2025-11-27 18:47:53 +03:00
parent 2e410fb402
commit 87bea09de0
2 changed files with 6 additions and 1 deletions

View File

@@ -1 +1,3 @@
VITE_API_URL=http://localhost:4000 VITE_API_URL=http://localhost:4000
# Prod için izin verilecek host(lar), virgülle ayırabilirsiniz. Örn:
# ALLOWED_HOSTS=wisecolt-ci-frontend-ft2pzo-1c0eb3-188-245-185-248.traefik.me

View File

@@ -1,10 +1,13 @@
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
const allowedHosts = process.env.ALLOWED_HOSTS?.split(",").map((h) => h.trim()).filter(Boolean);
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
server: { server: {
port: 5173, port: 5173,
host: true host: true,
...(allowedHosts?.length ? { allowedHosts } : {})
} }
}); });