feat: move all routes to resources folder
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
import { IngredientsList } from "../../components/IngredientsList.tsx";
|
||||
import { RecipeHero } from "../../components/RecipeHero.tsx";
|
||||
import { MainLayout } from "../../components/layouts/main.tsx";
|
||||
import { Recipe } from "../../lib/recipes.ts";
|
||||
import { getRecipe } from "../api/recipes/[name].ts";
|
||||
|
||||
export const handler: Handlers<Recipe | null> = {
|
||||
async GET(_, ctx) {
|
||||
const recipe = await getRecipe(ctx.params.name);
|
||||
return ctx.render(recipe);
|
||||
},
|
||||
};
|
||||
|
||||
export default function Greet(props: PageProps<Recipe>) {
|
||||
return (
|
||||
<MainLayout>
|
||||
<RecipeHero recipe={props.data} />
|
||||
<div class="px-8 text-white mt-10">
|
||||
<h3 class="text-3xl my-5">Ingredients</h3>
|
||||
<IngredientsList ingredients={props.data.ingredients} />
|
||||
<h3 class="text-3xl my-5">Preparation</h3>
|
||||
</div>
|
||||
</MainLayout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user