feat: add proxy server

This commit is contained in:
2025-01-19 19:49:24 +01:00
parent 78e94ccf82
commit ce38b2be0a
6 changed files with 33 additions and 10 deletions

View File

@ -9,6 +9,7 @@ import { KMenu } from "@islands/KMenu.tsx";
import PageHero from "@components/PageHero.tsx";
import { Star } from "@components/Stars.tsx";
import { renderMarkdown } from "@lib/documents.ts";
import { isValidRecipe } from "@lib/recipeSchema.ts";
export const handler: Handlers<{ recipe: Recipe; session: unknown } | null> = {
async GET(_, ctx) {
@ -24,11 +25,6 @@ export const handler: Handlers<{ recipe: Recipe; session: unknown } | null> = {
},
};
function isValidRecipe(recipe: Recipe | null) {
return recipe?.ingredients?.length && recipe?.instructions?.length &&
recipe.name?.length;
}
function ValidRecipe({
recipe,
amount,