Files
automaker/apps/server/src/routes/health.ts
SuperComboGamer 4b9bd2641f chore: update project management and API integration
- Added new scripts for server development and full application startup in package.json.
- Enhanced project management by checking for existing projects to avoid duplicates.
- Improved API integration with better error handling and connection checks in the Electron API.
- Updated UI components to reflect changes in project and session management.
- Refactored authentication status display to include more detailed information on methods used.
2025-12-12 00:23:43 -05:00

40 lines
913 B
TypeScript

/**
* Health check routes
*/
import { Router } from "express";
import { getAuthStatus } from "../lib/auth.js";
export function createHealthRoutes(): Router {
const router = Router();
// Basic health check
router.get("/", (_req, res) => {
res.json({
status: "ok",
timestamp: new Date().toISOString(),
version: process.env.npm_package_version || "0.1.0",
});
});
// Detailed health check
router.get("/detailed", (_req, res) => {
res.json({
status: "ok",
timestamp: new Date().toISOString(),
version: process.env.npm_package_version || "0.1.0",
uptime: process.uptime(),
memory: process.memoryUsage(),
dataDir: process.env.DATA_DIR || "./data",
auth: getAuthStatus(),
env: {
nodeVersion: process.version,
platform: process.platform,
arch: process.arch,
},
});
});
return router;
}