From b93258d74a14b52b259de08f7318500a2b0725cf Mon Sep 17 00:00:00 2001 From: iqbalpa Date: Thu, 11 Jul 2024 10:18:08 +0700 Subject: [PATCH] chore: store the api key in .env --- .env.example | 1 + src/api/api.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c0a0970 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +API_KEY= \ No newline at end of file diff --git a/src/api/api.tsx b/src/api/api.tsx index ed0e57e..c3966e6 100644 --- a/src/api/api.tsx +++ b/src/api/api.tsx @@ -3,8 +3,7 @@ import { Movie } from '@/constant/movie'; import { DetailMovie } from '@/constant/detailMovie'; const BASE_URL = 'https://api.themoviedb.org/3/'; -const API_KEY = - 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI1MzM0Njg0NjI2OTg1ODI3OTE1NzMyNWY5OTAxZmU4ZCIsIm5iZiI6MTcyMDU4OTg3MC4wMzYzNDIsInN1YiI6IjY2OGUxY2JlMzA0OTRhNmE2OTMyYzE3MCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.jkIXGMw1WWmtEO9XDryk4R5gP35WQIZHQ8uGIH-QgnM'; +const API_KEY = process.env.API_KEY const getAllMovies = async (currentPage: number): Promise => { const res = await axios.get(