mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
- 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.
40 lines
913 B
TypeScript
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;
|
|
}
|