feat: v1 release - serving calculator, notes UI, tags, random recipe, confetti, favorites section, PWA icons, category icons, animations
This commit is contained in:
@@ -2,6 +2,12 @@ import { FastifyInstance } from 'fastify';
|
||||
import * as svc from '../services/recipe.service.js';
|
||||
|
||||
export async function recipeRoutes(app: FastifyInstance) {
|
||||
app.get('/api/recipes/random', async (request, reply) => {
|
||||
const recipe = svc.getRandomRecipe();
|
||||
if (!recipe) return reply.status(404).send({ error: 'No recipes found' });
|
||||
return recipe;
|
||||
});
|
||||
|
||||
app.get('/api/recipes/search', async (request) => {
|
||||
const { q } = request.query as { q?: string };
|
||||
if (!q) return { data: [], total: 0 };
|
||||
|
||||
Reference in New Issue
Block a user