Skip to content

Commit 659576b

Browse files
committed
Refactor: update API_BASE_URL assignment to use type assertion
1 parent c5e0742 commit 659576b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

frontend/app/admin/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { Input } from "@/components/ui/input";
2525
import { Skeleton } from "@/components/ui/skeleton";
2626
import { api, DocumentInfo, KBStats, HealthStatus, isAdminKeyConfigured } from "@/lib/api";
2727

28-
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000";
28+
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL as string;
2929

3030
/**
3131
* Validates an API key by making a test request to the backend

frontend/hooks/useChat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { useState, useRef, useEffect, useCallback } from "react";
66
import { ChatMessage } from "@/types";
77

8-
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000";
8+
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL as string;
99

1010
interface UseChatOptions {
1111
initialMessages?: ChatMessage[];

frontend/lib/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* - Set NEXT_PUBLIC_ADMIN_API_KEY in .env.local
88
*/
99

10-
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000";
10+
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL as string;
1111

1212
// Admin API key from environment (required for admin operations)
1313
const ADMIN_API_KEY = process.env.NEXT_PUBLIC_ADMIN_API_KEY || "";

0 commit comments

Comments
 (0)