api: update key to api

This commit is contained in:
Cron1cle
2025-10-17 11:53:45 +02:00
parent 38ac309925
commit ceb7b86462
7 changed files with 55 additions and 20 deletions

View File

@@ -8,7 +8,13 @@ const STREAMING_SERVICE_API_URL = "http://45.157.177.99:8080/config";
export async function getStreamingImages(): Promise<StreamingServiceRaw[]> {
try {
const response = await fetch(STREAMING_SERVICE_API_URL);
const apiKey = process.env.EXPO_PUBLIC_API_KEY;
const response = await fetch(STREAMING_SERVICE_API_URL, {
headers: {
"Content-Type": "application/json",
"X-API-Key": apiKey ?? "",
},
});
if (!response.ok) {
throw new Error("Network response was not ok");
}