12 lines
329 B
TypeScript
12 lines
329 B
TypeScript
import { HandlerContext } from "$fresh/server.ts";
|
|
import { getDocuments } from "../../lib/documents.ts";
|
|
|
|
export const handler = async (
|
|
_req: Request,
|
|
_ctx: HandlerContext,
|
|
): Promise<Response> => {
|
|
const documents = await getDocuments();
|
|
const response = new Response(JSON.stringify(documents));
|
|
return response;
|
|
};
|