17 lines
432 B
TypeScript
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});
|
|
},
|
|
} |