13 lines
375 B
TypeScript
13 lines
375 B
TypeScript
import { HandlerContext, Handlers } from "$fresh/server.ts";
|
|
import { SAMPLE_DATA, RepoData, searchRepos, getRepos } from "../../api/repo.ts";
|
|
|
|
export const handler: Handlers = {
|
|
async GET(_req, _ctx) {
|
|
const repos = await getRepos();
|
|
return new Response(JSON.stringify(repos), {
|
|
headers: {
|
|
"content-type": "application/json",
|
|
},
|
|
});
|
|
},
|
|
}; |