diff --git a/.gitignore b/.gitignore index 4d29575..b59ec02 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +.env diff --git a/src/components/TextToImageGenerator.js b/src/components/TextToImageGenerator.js index 07914f3..7c04fc7 100644 --- a/src/components/TextToImageGenerator.js +++ b/src/components/TextToImageGenerator.js @@ -24,7 +24,7 @@ const TextToImageGenerator = () => { method: 'POST', // HTTP method url: 'https://ai-image-generator3.p.rapidapi.com/generate', // API endpoint headers: { - 'x-rapidapi-key': ' b7d718cc59msh784bc7993d213edp1bd4e7jsnc31a912a13ce', // API key + 'X-Rapidapi-Key': process.env.REACT_APP_RAPIDAPI_KEY, 'x-rapidapi-host': 'ai-image-generator3.p.rapidapi.com', // API host 'Content-Type': 'application/json' // Content type of the request },