From the course: Build a JavaScript AI App with React and the OpenAI API
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Work with the OpenWeatherMap API
From the course: Build a JavaScript AI App with React and the OpenAI API
Work with the OpenWeatherMap API
- [Instructor] The weather app we'll be working on together throughout this course relies on the OpenWeatherMap APIs to gain location information and weather information for that location. So, for our app to work, we need to connect it to OpenWeatherMap. That's done by adding your private API key to our project. And that's done in a new file you'll create from this file here that's called n.local. So grab n.local.template, copy it and paste it in, then rename the new file to just n.local. And inside here, we'll eventually save the open AI key, but we don't need that yet, so I'll delete it for now. And we'll also save the OpenWeatherMap key. Now, it's important to note here, this is not for production. You never publish an API key in a file like this when you publish content to the web because if you do, that API key becomes public knowledge. Anyone can access it, and anyone can use it. If you want to host an application,…