webforai.kr 이 AI Discovery 랜딩을 띄워야 하는데, /discovery 는 infinith-demo 안의 경로라 도메인만 붙이면 기존 INFINITH 랜딩이 뜬다. SPA 라 rewrite 로도 안 된다. React Router 가 주소로 판단하기 때문이다. VITE_SITE=discovery 로 빌드한 배포만 루트에 AI Discovery 랜딩을 놓는다. 값이 없으면 지금까지처럼 INFINITH 랜딩이다. infinith-demo 의 동작은 바뀌지 않는다. 한 코드베이스로 두 사이트를 내는 방식이라 랜딩을 고칠 때 양쪽에 한 번에 반영된다. 검증: 변수 없는 빌드와 VITE_SITE=discovery 빌드 모두 성공, tsc 0 에러. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
56 lines
3.0 KiB
TypeScript
56 lines
3.0 KiB
TypeScript
import { StrictMode } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import { BrowserRouter, Routes, Route } from 'react-router';
|
|
import App from './App.tsx';
|
|
import LandingPage from './pages/LandingPage.tsx';
|
|
import PricingPage from './pages/PricingPage.tsx';
|
|
import AnalysisLoadingPage from './pages/AnalysisLoadingPage.tsx';
|
|
import ReportPage from './pages/ReportPage.tsx';
|
|
import MarketingPlanPage from './pages/MarketingPlanPage.tsx';
|
|
import ContentStudioPage from './pages/ContentStudioPage.tsx';
|
|
import ChannelConnectPage from './pages/ChannelConnectPage.tsx';
|
|
import DistributionPage from './pages/DistributionPage.tsx';
|
|
import PerformancePage from './pages/PerformancePage.tsx';
|
|
import DataValidationPage from './pages/DataValidationPage.tsx';
|
|
import ClinicProfilePage from './pages/ClinicProfilePage.tsx';
|
|
import ApiDashboardPage from './pages/ApiDashboardPage.tsx';
|
|
import LoginPage from './pages/LoginPage.tsx';
|
|
import DiscoveryLandingPage from './pages/DiscoveryLandingPage.tsx';
|
|
import DiscoveryReportPage from './pages/DiscoveryReportPage.tsx';
|
|
import SupportersBuildPage from './pages/SupportersBuildPage.tsx';
|
|
import './index.css';
|
|
|
|
// 배포별 루트 페이지 분기. Vercel 프로젝트의 환경변수로 정한다.
|
|
const DISCOVERY_SITE = import.meta.env.VITE_SITE === 'discovery';
|
|
|
|
createRoot(document.getElementById('root')!).render(
|
|
<StrictMode>
|
|
<BrowserRouter>
|
|
<Routes>
|
|
<Route element={<App />}>
|
|
{/* 루트에서 무엇을 그릴지는 배포마다 다르다. VITE_SITE=discovery 로 빌드한 배포(webforai.kr)는
|
|
AI Discovery 랜딩을 루트에 놓고, 값이 없으면 지금까지처럼 INFINITH 랜딩을 놓는다.
|
|
한 코드베이스로 두 사이트를 내되 기존 배포의 동작은 바꾸지 않는다. */}
|
|
<Route index element={DISCOVERY_SITE ? <DiscoveryLandingPage /> : <LandingPage />} />
|
|
<Route path="pricing" element={<PricingPage />} />
|
|
<Route path="login" element={<LoginPage />} />
|
|
<Route path="report/loading" element={<AnalysisLoadingPage />} />
|
|
<Route path="report/loading/:reportId" element={<AnalysisLoadingPage />} />
|
|
<Route path="report/:id" element={<ReportPage />} />
|
|
<Route path="plan/:id" element={<MarketingPlanPage />} />
|
|
<Route path="studio/:id" element={<ContentStudioPage />} />
|
|
<Route path="channels" element={<ChannelConnectPage />} />
|
|
<Route path="distribute" element={<DistributionPage />} />
|
|
<Route path="performance" element={<PerformancePage />} />
|
|
<Route path="data-validation" element={<DataValidationPage />} />
|
|
<Route path="clinic/:id" element={<ClinicProfilePage />} />
|
|
<Route path="api-dashboard" element={<ApiDashboardPage />} />
|
|
<Route path="discovery" element={<DiscoveryLandingPage />} />
|
|
<Route path="discovery/:id" element={<DiscoveryReportPage />} />
|
|
<Route path="supporters/:id" element={<SupportersBuildPage />} />
|
|
</Route>
|
|
</Routes>
|
|
</BrowserRouter>
|
|
</StrictMode>,
|
|
);
|