// Cipher — end-to-end encrypted messenger on Cloudflare Workers. // The Worker is a key directory + encrypted relay. It never sees plaintext. import { Hono } from "hono"; import auth from "./routes/auth.js"; import keys from "./routes/keys.js"; import messages from "./routes/messages.js"; import media from "./routes/media.js"; export { Mailbox } from "./do/mailbox.js"; const app = new Hono(); app.get("/api/health", (c) => c.json({ ok: true, service: "cipher" })); app.route("/api/auth", auth); app.route("/api", keys); app.route("/api", messages); app.route("/api", media); // Everything else falls through to static assets (the PWA), handled by the // ASSETS binding via not_found_handling: single-page-application. app.all("/api/*", (c) => c.json({ error: "not found" }, 404)); export default app;