boilerplate for formatting and basic routes

This commit is contained in:
2026-05-27 22:08:24 +02:00
parent 14eb7fab13
commit 34ebb6f876
5 changed files with 52 additions and 5 deletions
+2
View File
@@ -0,0 +1,2 @@
profile = default
version = 0.28.1
+1 -1
View File
@@ -1,4 +1,4 @@
(executable
(public_name chess-scribe-api)
(name main)
(libraries chess_scribe_api))
(libraries chess_scribe_api dream))
+8 -1
View File
@@ -1 +1,8 @@
let () = print_endline "Hello, World!"
let () =
Dream.run @@ Dream.logger
@@ Dream.router
[
Dream.get "/" (fun _ -> Dream.html "API Docs");
Dream.get "/health" (fun _ -> Dream.html "Health Check");
Dream.get "/pdf" (fun _ -> Dream.html "Generate PDF");
]
+34
View File
@@ -0,0 +1,34 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "API for chess-scribe.org"
description:
"The backend that powers chess-scribe.org. Convert chess PGN files into PDFs."
maintainer: ["Owen Rees <owenrees.dev@gmail.com>"]
authors: ["Owen Rees<owenrees.dev@gmail.com>"]
license: "AGPLv3"
tags: ["chess" "pgn" "pdf"]
homepage: "https://github.com/therealowenrees/chess-scribe-api"
doc: "https://url/to/documentation"
bug-reports: "https://github.com/therealowenrees/chess-scribe-api/issues"
depends: [
"dune" {>= "3.21"}
"ocaml"
"dream" {>= "1.0.0~alpha8"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/therealowenrees/chess-scribe-api.git"
x-maintenance-intent: ["(latest)"]
+7 -3
View File
@@ -17,9 +17,13 @@
(package
(name chess-scribe-api)
(synopsis "A short synopsis")
(description "A longer description")
(depends ocaml)
(synopsis "API for chess-scribe.org")
(description
"The backend that powers chess-scribe.org. Convert chess PGN files into PDFs.")
(depends
ocaml
(dream
(>= "1.0.0~alpha8")))
(tags
("chess" "pgn" "pdf")))