search_awesome/routes/api/_list.ts

13 lines
375 B
TypeScript
Raw Normal View History

2022-12-01 19:40:03 +09:00
import { HandlerContext, Handlers } from "$fresh/server.ts";
import { SAMPLE_DATA, RepoData, searchRepos, getRepos } from "../../api/repo.ts";
2022-11-29 01:52:44 +09:00
2022-12-01 19:40:03 +09:00
export const handler: Handlers = {
async GET(_req, _ctx) {
const repos = await getRepos();
return new Response(JSON.stringify(repos), {
headers: {
"content-type": "application/json",
},
});
},
};