17 lines
431 B
TypeScript
17 lines
431 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("KOSPI")
|
|
.select([
|
|
"Code",
|
|
"Name"
|
|
])
|
|
.execute();
|
|
return new Response(JSON.stringify(rows), {headers});
|
|
},
|
|
} |