- Move services/nextjs to nextjs/ - Move deploy/docker/Dockerfile.prod to Dockerfile - Add GitHub Actions workflows (ci.yml, build.yml) - Remove deploy/, services/, scripts/ folders
28 lines
682 B
TypeScript
28 lines
682 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { db } from '@/shared/lib/db';
|
|
|
|
export async function GET() {
|
|
try {
|
|
// Check database connectivity
|
|
await db.$queryRaw`SELECT 1`;
|
|
|
|
return NextResponse.json({
|
|
status: 'healthy',
|
|
timestamp: new Date().toISOString(),
|
|
uptime: process.uptime(),
|
|
environment: process.env.NODE_ENV,
|
|
version: process.env.npm_package_version || '1.0.0',
|
|
database: 'connected'
|
|
});
|
|
} catch (error) {
|
|
return NextResponse.json(
|
|
{
|
|
status: 'unhealthy',
|
|
timestamp: new Date().toISOString(),
|
|
error: 'Database connection failed'
|
|
},
|
|
{ status: 503 }
|
|
);
|
|
}
|
|
}
|