refactor(env): replace inline process.env reads with BACKEND_URL in editor, chat, dashboard and settings

This commit is contained in:
Varun Shukla 2026-05-19 01:29:31 +05:30
parent 8174949b38
commit fead3a64f4
10 changed files with 33 additions and 27 deletions

View file

@ -10,7 +10,7 @@ import { trackAnonymousChatMessageSent } from "@/lib/posthog/events";
import { cn } from "@/lib/utils";
import { QuotaBar } from "./quota-bar";
import { QuotaWarningBanner } from "./quota-warning-banner";
import { BACKEND_URL } from "@/lib/env-config";
interface Message {
id: string;
role: "user" | "assistant";
@ -81,7 +81,7 @@ export function AnonymousChat({ model }: AnonymousChatProps) {
}));
const response = await fetch(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000"}/api/v1/public/anon-chat/stream`,
`${BACKEND_URL}/api/v1/public/anon-chat/stream`,
{
method: "POST",
headers: { "Content-Type": "application/json" },