peppa/bench/tasks/01-landing/solution/product/routes.mjs
2026-11-17 02:09:17 +05:00

22 lines
1.0 KiB
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.

// BENCH-HIDDEN — эталонное решение задачи 1.
import { html, page } from "./lib/http.mjs";
const body = `
<h1>Зерно</h1>
<p>Кофе, который обжариваем сами</p>
<h2>Почему к нам</h2>
<ul>
<li>Свежая обжарка каждую неделю</li>
<li>Десерты собственного приготовления</li>
<li>Тихий зал для работы, розетки у каждого стола</li>
</ul>
<h2>Меню</h2>
<ul><li>Эспрессо — 900 ₸</li><li>Капучино — 1 300 ₸</li><li>Раф — 1 600 ₸</li></ul>
<p>Алматы, ул. Панфилова, 98 · ежедневно с 8:00 до 22:00</p>
<p><a href="tel:+77011234567" style="font-size:1.5rem">Позвонить</a></p>`;
export const routes = [
{ method: "GET", path: "/healthz", handler: ({ res }) => res.writeHead(200).end("ok") },
{ method: "GET", path: "/", handler: ({ res }) => html(res, page("Зерно — кофейня", body)) },
];