This commit is contained in:
2025-08-28 14:34:18 +02:00
commit 5ff4c53a10
29 changed files with 1705 additions and 0 deletions

13
TP4/EX2/service.js Normal file
View File

@@ -0,0 +1,13 @@
export const getMovies = async (search) => {
const apiKey = '2fcb2848';
const url = `https://www.omdbapi.com/?apikey=${apiKey}&s=${encodeURIComponent(search)}`;
try {
const response = await fetch(url);
const data = await response.json();
return data.Search || [];
} catch (error) {
console.error("Erreur lors de la recherche de films:", error);
return [];
}
};