Stock/routes/api/kosdaq.ts
2023-10-26 23:58:33 +09:00

17 lines
432 B
TypeScript

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