Skip to content

Kendi weather app#56

Open
kendigm wants to merge 1 commit into
rocketacademy:mainfrom
kendigm:main
Open

Kendi weather app#56
kendigm wants to merge 1 commit into
rocketacademy:mainfrom
kendigm:main

Conversation

@kendigm
Copy link
Copy Markdown

@kendigm kendigm commented Nov 28, 2023

No description provided.

Comment thread src/App.js
const [input, setInput] = useState("");
const [data, setData] = useState({});
const [cityName, setCityName] = useState("");
const API_KEY = "7c52b0b346e3515a9d1950f5fd508f09";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never hardcode your api keys into your code. This is a big security risk and can lead to you paying lots of dollars by someone else misusing this. Since this github repo is publicly available, you could face big issues with this if it was a google api key or something else that charges by number of requests.

Please revise https://bootcamp.rocketacademy.co/2-full-stack/2.2-advanced-react/2.2.7-environmental-variables

Comment thread src/App.js
`https://api.openweathermap.org/data/2.5/forecast?lat=${geoData.lat}&lon=${geoData.lon}&appid=${API_KEY}`
)
.then((response) => {
setData(response.data.list[0].main);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works, as you do not return the result of the axios request in the previous .then block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants