11 lines
283 B
TypeScript

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