import { Handlers } from "$fresh/server.ts"; import { db } from "../../db/db.ts"; export const handler: Handlers = { async GET(req, _ctx): Promise { const headers = new Headers({ "content-type": "application/json" }); const rows = await db.selectFrom("KOSPI") .select([ "Code", "Name" ]) .execute(); return new Response(JSON.stringify(rows), {headers}); }, }