removed hard coded api key

This commit is contained in:
andres alcocer
2020-05-15 15:02:57 -04:00
parent 3faffa603a
commit 50d2c1dfad
15 changed files with 29 additions and 37 deletions

View File

@@ -9,11 +9,9 @@ export const FETCH_HORROR_MOVIES = 'FETCH_HORROR_MOVIES';
export const FETCH_ROMANCE_MOVIES = 'FETCH_ROMANCE_MOVIES';
export const FETCH_DOCUMENTARIES = 'FETCH_DOCUMENTARIES';
const API_KEY = '224ce27b38a3805ecf6f6c36eb3ba9d0';
export function fetchTrending() {
const request = axios.get(
`/trending/all/week?api_key=${API_KEY}&language=en-US`
`/trending/all/week?api_key=${process.env.API_KEY}&language=en-US`
);
return {
@@ -35,7 +33,7 @@ export function fetchNetflixOriginals() {
export function fetchTopRated() {
const request = axios.get(
`/movie/top_rated?api_key=${API_KEY}&language=en-US`
`/movie/top_rated?api_key=${process.env.API_KEY}&language=en-US`
);
return {
@@ -46,7 +44,7 @@ export function fetchTopRated() {
export function fetchActionMovies() {
const request = axios.get(
`/discover/movie?api_key=${API_KEY}&with_genres=28`
`/discover/movie?api_key=${process.env.API_KEY}&with_genres=28`
);
return {
@@ -57,7 +55,7 @@ export function fetchActionMovies() {
export function fetchComedyMovies() {
const request = axios.get(
`/discover/movie?api_key=${API_KEY}&with_genres=35`
`/discover/movie?api_key=${process.env.API_KEY}&with_genres=35`
);
return {
@@ -68,7 +66,7 @@ export function fetchComedyMovies() {
export function fetchHorrorMovies() {
const request = axios.get(
`/discover/movie?api_key=${API_KEY}&with_genres=27`
`/discover/movie?api_key=${process.env.API_KEY}&with_genres=27`
);
return {
@@ -79,7 +77,7 @@ export function fetchHorrorMovies() {
export function fetchRomanceMovies() {
const request = axios.get(
`/discover/movie?api_key=${API_KEY}&with_genres=10749`
`/discover/movie?api_key=${process.env.API_KEY}&with_genres=10749`
);
return {
@@ -90,7 +88,7 @@ export function fetchRomanceMovies() {
export function fetchDocumentaries() {
const request = axios.get(
`/discover/movie?api_key=${API_KEY}&with_genres=99`
`/discover/movie?api_key=${process.env.API_KEY}&with_genres=99`
);
return {