Question · Vibe coding with Claude Code course · Module 9: Discord clone

Quiz: Where the widget gets the weather

How does WeatherWidget get the weather from OpenWeather?

Answer options

  • It calls OpenWeather with the key from NEXT_PUBLIC_OPENWEATHER_API_KEY
  • It calls its own /api/weather route, and the route asks OpenWeather with the key from process.env
  • It imports the .env.local file and builds the address with the key itself
  • It fetches the key from the /api/weather route and asks OpenWeather from the browser

You can check the correct answer by solving this task in the CodeWorlds game.