import { wrapAsyncHandler } from "@batch-cooking/express-tools"; import { Router } from "express"; import { getAllergies, getDiets } from "./reference.service.js"; /** * Router mounted at `/reference` in app.ts. Both routes are deliberately * public (no `requireAuth`) — this is static reference data, not * per-household state, and the signup wizard (household/regime/allergen * steps) needs to read it before an account — and therefore a session — * exists. */ export const referenceRouter = Router(); referenceRouter.get( "/diets", wrapAsyncHandler(async (_req, res) => { res.status(200).json(await getDiets()); }), ); referenceRouter.get( "/allergies", wrapAsyncHandler(async (_req, res) => { res.status(200).json(await getAllergies()); }), );