From 87bea09de0346ba856b7bbc47139b99b02dc8d07 Mon Sep 17 00:00:00 2001 From: sbilketay Date: Thu, 27 Nov 2025 18:47:53 +0300 Subject: [PATCH] =?UTF-8?q?prod=20i=C3=A7in=20Allowed=5FHost=20eklendi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.env.example | 2 ++ frontend/vite.config.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/.env.example b/frontend/.env.example index 1fad084..2205fd6 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1 +1,3 @@ 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 diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index ba0295d..e5fa1ed 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,10 +1,13 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; +const allowedHosts = process.env.ALLOWED_HOSTS?.split(",").map((h) => h.trim()).filter(Boolean); + export default defineConfig({ plugins: [react()], server: { port: 5173, - host: true + host: true, + ...(allowedHosts?.length ? { allowedHosts } : {}) } });