Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
/.pnp
.pnp.js

# env files
.env

# testing
/coverage

Expand Down
6 changes: 5 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -17,6 +19,8 @@ function App() {
setSearch(e.target.value);
}

const apiKey = process.env.REACT_APP_RAPIDAPI_KEY;

async function geoHandler() {
setSearch('');
setIsLoading(true);
Expand All @@ -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',
},
};
Expand Down