mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat: add auto-start server feature for CLI
- Added /health endpoint to server for readiness checks (no auth required) - Created autoStartServer module that auto-starts server when: - HAPI_SERVER_URL not set (using default localhost:3006) - cliApiToken exists in settings (server previously used) - Port 3006 is not currently listening - Server runs as child process (not daemon) and exits when CLI exits - Integrated maybeAutoStartServer() into hapi, codex, and gemini commands
This commit is contained in:
@@ -61,6 +61,9 @@ function createWebApp(options: {
|
||||
|
||||
app.use('*', logger())
|
||||
|
||||
// Health check endpoint (no auth required)
|
||||
app.get('/health', (c) => c.json({ status: 'ok' }))
|
||||
|
||||
const corsOrigins = configuration.corsOrigins
|
||||
const corsOriginOption = corsOrigins.includes('*') ? '*' : corsOrigins
|
||||
const corsMiddleware = cors({
|
||||
|
||||
Reference in New Issue
Block a user