mirror of
https://github.com/TheRealOwenRees/chess-scribe-api.git
synced 2026-07-23 01:06:56 +00:00
api home also shows docs
This commit is contained in:
+6
-4
@@ -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);
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user