refactor: modularize codebase and add DB workload multiplier
- Split monolithic index.ts (2370 lines) into modular structure: - src/handlers/ for route handlers - src/utils.ts for shared utilities - src/config.ts for configuration - src/types.ts for TypeScript definitions - Add DB workload multiplier for smarter database resource calculation: - Heavy (analytics, logs): 0.3x multiplier - Medium-heavy (e-commerce, transactional): 0.5x - Medium (API, SaaS): 0.7x - Light (blog, portfolio): 1.0x - Fix tech_specs with realistic vcpu_per_users values (150+ technologies) - Fix "blog" matching "log" regex bug - Update documentation to reflect new architecture Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
20
src/handlers/health.ts
Normal file
20
src/handlers/health.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Health check endpoint handler
|
||||
*/
|
||||
|
||||
import { jsonResponse } from '../utils';
|
||||
|
||||
/**
|
||||
* Health check endpoint
|
||||
*/
|
||||
export function handleHealth(corsHeaders: Record<string, string>): Response {
|
||||
return jsonResponse(
|
||||
{
|
||||
status: 'ok',
|
||||
timestamp: new Date().toISOString(),
|
||||
service: 'server-recommend',
|
||||
},
|
||||
200,
|
||||
corsHeaders
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user