Simple API gateway for webhooks

fix: geocode data fetch

finxol.io 641b4660 ae6a41dc

verified
+10 -2
+9
src/main.ts
··· 52 52 `) 53 53 }) 54 54 55 + if (Deno.env.get("DENO_ENV") === "dev") { 56 + const kv = await Deno.openKv() 57 + const { default: data } = await import("../test.json", { with: { type: "json" } }) 58 + kv.set( 59 + ["sensors", "latest"], 60 + { ...data }, 61 + ) 62 + } 63 + 55 64 Deno.serve(app.fetch)
+1 -2
src/sensors.ts
··· 151 151 Deno.env.get("GEOAPIFY_API_KEY") 152 152 }`, 153 153 ) 154 - .then((res) => res.json()) 155 - .then((data) => data.features[0].properties.country_code), 154 + .then((res) => res.json()), 156 155 ) 157 156 158 157 if (!geocode.success) {