From 2d304c7c62bea753e0d214cb1bb63cb3551be991 Mon Sep 17 00:00:00 2001 From: Christian Angelo M Sulit Date: Wed, 23 Oct 2024 18:19:20 +0800 Subject: [PATCH] Update server.ts --- server.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.ts b/server.ts index b76c067..1e81ab1 100644 --- a/server.ts +++ b/server.ts @@ -1,5 +1,6 @@ import "jsr:@std/dotenv/load"; import { type Context, Hono } from "jsr:@hono/hono"; +import { cors } from "jsr:@hono/hono/cors; import { dbPool } from "./config/postgres.ts"; import { getKvInstance, listenQueue, sendMessage } from "./config/deno-kv.ts"; @@ -7,6 +8,10 @@ import { getKvInstance, listenQueue, sendMessage } from "./config/deno-kv.ts"; const app = new Hono(); const kv = await getKvInstance(); +app.use(cors({ + origin: "*", + })); + app.get("/api/properties", async (c: Context) => { using client = await dbPool.connect(); const query = c.req.query() as unknown as {