mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-24 12:05:05 +03:00
Change the structure
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { API_BASE_URL } from "@/core/config";
|
||||
import { getAuthHeaders } from "./user/auth";
|
||||
import type { IceServersResponse } from "@/core/types";
|
||||
|
||||
/**
|
||||
* Fetches ICE server configuration for WebRTC
|
||||
*/
|
||||
export async function iceServers(token: string): Promise<IceServersResponse> {
|
||||
const res = await fetch(`${API_BASE_URL}/webrtc/ice`, {
|
||||
headers: getAuthHeaders(token, true)
|
||||
});
|
||||
if (!res.ok) throw new Error("Failed to fetch ICE servers");
|
||||
return await res.json();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user