import { html, json, 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("Гостиница «Медеу»", '
Алматы, ул. Горная, 12.
')), }, // Помощник для гостей: страница /chat, ответы — POST /api/chat { message } → { reply }. { method: "GET", path: "/chat", handler: ({ res }) => html(res, page("Помощник", "Скоро здесь можно будет задать вопрос.
")) }, { method: "POST", path: "/api/chat", handler: ({ res }) => json(res, 501, { error: "Пока не сделано" }) }, ];