Simple API gateway for webhooks

fix: geocode data fetch

finxol.io 641b4660 ae6a41dc

verified
Changed files
+10 -2
src
+9
src/main.ts
···
`)
})
+
if (Deno.env.get("DENO_ENV") === "dev") {
+
const kv = await Deno.openKv()
+
const { default: data } = await import("../test.json", { with: { type: "json" } })
+
kv.set(
+
["sensors", "latest"],
+
{ ...data },
+
)
+
}
+
Deno.serve(app.fetch)
+1 -2
src/sensors.ts
···
Deno.env.get("GEOAPIFY_API_KEY")
}`,
)
-
.then((res) => res.json())
-
.then((data) => data.features[0].properties.country_code),
+
.then((res) => res.json()),
)
if (!geocode.success) {