From bff2db3035e0162ed68685c61bed9381edc3f2ca Mon Sep 17 00:00:00 2001 From: Kaushal Poojary <101418328+Kaushal-Poojary@users.noreply.github.com> Date: Fri, 11 Aug 2023 03:42:23 +0530 Subject: [PATCH 1/2] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 4d29575..2706b36 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ /.pnp .pnp.js +# env files +.env + # testing /coverage From 99b5782592c0624d761dd8bdc14dab89adc322f2 Mon Sep 17 00:00:00 2001 From: Kaushal Poojary <101418328+Kaushal-Poojary@users.noreply.github.com> Date: Fri, 11 Aug 2023 03:50:36 +0530 Subject: [PATCH 2/2] Hid Rapid Api Key --- src/App.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 99bd8f3..d76f0d6 100644 --- a/src/App.js +++ b/src/App.js @@ -4,6 +4,8 @@ import { useState, useEffect } from 'react'; import Weather from './components/Weather'; import LoadingIndicator from './UI/LoadingIndicator'; +require('dotenv').config(); + import './app.css'; function App() { @@ -17,6 +19,8 @@ function App() { setSearch(e.target.value); } + const apiKey = process.env.REACT_APP_RAPIDAPI_KEY; + async function geoHandler() { setSearch(''); setIsLoading(true); @@ -32,7 +36,7 @@ function App() { const options = { method: 'GET', headers: { - 'X-RapidAPI-Key': '0173291af0msh62b3ca25953f210p13d732jsn66b4d9f97708', + 'X-RapidAPI-Key': apiKey, 'X-RapidAPI-Host': 'weatherapi-com.p.rapidapi.com', }, };