peppa/bench/tasks/07-vague/repo/product/routes.mjs
Асель d108197f0f PEP-184: задачи 5–8, тест набора, archive change, память
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 02:09:17 +05:00

20 lines
818 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { html, page } from "./lib/http.mjs";
export const routes = [
{
method: "GET",
path: "/healthz",
handler: ({ res }) => {
res.writeHead(200, { "content-type": "text/plain; charset=utf-8" });
res.end("ok");
},
},
{
method: "GET",
path: "/",
handler: ({ res }) => html(res, page("Таба нан", '<h1>Пекарня «Таба нан»</h1><p>Свежий хлеб каждое утро с 7:00.</p><p><a href="/reviews">Отзывы</a></p>')),
},
// Отзывы: страница /reviews, данные — сущность reviews (см. «Соглашения API» в AGENTS.md).
{ method: "GET", path: "/reviews", handler: ({ res }) => html(res, page("Отзывы", "<h1>Отзывы</h1><p>Скоро здесь будут отзывы.</p>")) },
];