feat: add REST routes for devices, goals, and health

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sanju Sivalingam
2026-02-17 14:21:11 +05:30
parent 8fe3ad9926
commit 577c195862
5 changed files with 102 additions and 2 deletions

View File

@@ -8,6 +8,9 @@ import {
handleDashboardClose,
} from "./ws/dashboard.js";
import type { WebSocketData } from "./ws/sessions.js";
import { devices } from "./routes/devices.js";
import { goals } from "./routes/goals.js";
import { health } from "./routes/health.js";
const app = new Hono();
@@ -27,8 +30,10 @@ app.on(["POST", "GET"], "/api/auth/*", (c) => {
return auth.handler(c.req.raw);
});
// Health check
app.get("/health", (c) => c.json({ status: "ok" }));
// REST routes
app.route("/devices", devices);
app.route("/goals", goals);
app.route("/health", health);
// Start server with WebSocket support
const server = Bun.serve<WebSocketData>({