chore(self-hosting): add health check endpoint (#3562)

Add a simple API health route for deployment platforms and container probes, with focused route coverage.

Co-authored-by: test <test@example.com>
This commit is contained in:
PlaneInABottle
2026-03-13 12:10:39 +03:00
committed by GitHub
parent d90f828e88
commit d84cba6d19
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/**
* @vitest-environment node
*/
import { describe, expect, it } from 'vitest'
import { GET } from '@/app/api/health/route'
describe('GET /api/health', () => {
it('returns an ok status payload', async () => {
const response = await GET()
expect(response.status).toBe(200)
await expect(response.json()).resolves.toEqual({
status: 'ok',
timestamp: expect.any(String),
})
})
})

View File

@@ -0,0 +1,12 @@
/**
* Health check endpoint for deployment platforms and container probes.
*/
export async function GET(): Promise<Response> {
return Response.json(
{
status: 'ok',
timestamp: new Date().toISOString(),
},
{ status: 200 }
)
}