dernier slide

This commit is contained in:
Julien LEICHER 2022-03-22 19:07:47 +01:00
parent 0bd89f30f0
commit f540d03c1d
No known key found for this signature in database
GPG Key ID: BE0761B6A007EB96
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import fetch from "node-fetch";
import { v4 as uuid } from "uuid";
const db = new Database("weathery.db");
const APPID = "d6f0f985f37372e9824c68a52662cc23";
const app = fastify({
logger: true,
@ -36,7 +37,7 @@ app.get("/", async () => {
locations.map(async (location) => {
const { lat, lon } = location;
const { weather, main: properties } = await fetch(
`https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=d6f0f985f37372e9824c68a52662cc23&units=metric`
`https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${APPID}&units=metric`
).then((r) => r.json());
return {