mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-06 02:26:49 +00:00
12 lines
315 B
TypeScript
12 lines
315 B
TypeScript
import { parseRecipeData } from "~/utils/recipes";
|
|
|
|
export default defineEventHandler(async (_event) => {
|
|
const { apiUrl } = useRuntimeConfig();
|
|
|
|
const data = await $fetch<{ meals: unknown }>(
|
|
new URL("random.php", apiUrl).toString(),
|
|
);
|
|
|
|
const recipes = parseRecipeData(data);
|
|
return recipes[0];
|
|
});
|