Files
memorium/routes/api/recipes/[name].ts
2025-10-28 20:15:23 +01:00

11 lines
297 B
TypeScript

import { Handlers } from "$fresh/server.ts";
import { json } from "@lib/helpers.ts";
import { fetchResource } from "@lib/resources.ts";
export const handler: Handlers = {
async GET(_, ctx) {
const recipe = await fetchResource(`recipes/${ctx.params.name}`);
return json(recipe);
},
};