add health check

This commit is contained in:
2026-03-07 22:37:29 -05:00
parent 7106dcc745
commit 6a11f8e878

View File

@@ -128,6 +128,16 @@ parse_access_key_from_auth :: proc(auth_header: string) -> (access_key: string,
// DynamoDB request handler - called for each HTTP request with request-scoped arena allocator
handle_dynamodb_request :: proc(ctx_raw: rawptr, request: ^HTTP_Request, request_alloc: mem.Allocator) -> HTTP_Response {
// fast health check no auth and no body
if request.path == "/health" {
response := response_init(request_alloc) // HEAD requests dont need a body
// GET fallback
if request.method != .HEAD {
response_set_body(&response, transmute([]byte)string("1")) // GET needs a body :(
}
return response
}
// Snag the engine from the ctx wrapper
ctx := cast(^Handler_Context)ctx_raw
engine := ctx.engine