From 761ae95175767f3b6daeca0d0478a4fc24d122f7 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 27 May 2026 23:16:48 +0200 Subject: [PATCH] api home also shows docs --- bin/main.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/main.ml b/bin/main.ml index 5c9c709..145d657 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -3,14 +3,16 @@ let () = @@ Dream.logger @@ Dream.router [ - (* 1. Health check (Exact match) *) + Dream.get "/" (fun request -> + Dream.from_filesystem "static" "doc.html" request); + (* Health check (Exact match) *) Dream.get "/health" (fun _ -> Dream.respond "OK"); - (* 2. Specific API Endpoints (Must be ABOVE the wildcard) *) + (* Specific API Endpoints (Must be ABOVE the wildcard) *) Dream.get "/api/v1/pdf" (fun _ -> Dream.html "Generate PDF"); - (* 3. Exact match for the docs root *) + (* Exact match for the docs root *) Dream.get "/api/v1" (fun request -> Dream.from_filesystem "static" "doc.html" request); - (* 4. Dedicated route for swagger.json if accessed outside /api/ *) + (* Dedicated route for swagger.json if accessed outside /api/ *) Dream.get "/swagger.json" (fun request -> Dream.from_filesystem "static" "swagger.json" request); ]