From 6a11f8e878be74353a11bdea28c090dd3659c6e7 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Sat, 7 Mar 2026 22:37:29 -0500 Subject: [PATCH] add health check --- main.odin | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.odin b/main.odin index 42f63ef..f3cb83c 100644 --- a/main.odin +++ b/main.odin @@ -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