feat: init
This commit is contained in:
11
routes/api/index.ts
Normal file
11
routes/api/index.ts
Normal file
@ -0,0 +1,11 @@
|
||||
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;
|
||||
};
|
Reference in New Issue
Block a user