diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2025-06-01 17:12:06 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2025-06-14 10:58:01 +0200 |
commit | 2f18b8a33cabd0ea666781ba048d0174b4dc5031 (patch) | |
tree | aacda421b89e8133e3c73942e9ede61283a5005c /services |
Initial commit
Diffstat (limited to 'services')
-rw-r--r-- | services/dune | 10 | ||||
-rw-r--r-- | services/nb_car.ml | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/services/dune b/services/dune new file mode 100644 index 0000000..fe10406 --- /dev/null +++ b/services/dune @@ -0,0 +1,10 @@ +(library + (name services_impl) + (libraries + path + services + v_string + ) + (preprocess (pps ppx_yojson_conv)) + ) + diff --git a/services/nb_car.ml b/services/nb_car.ml new file mode 100644 index 0000000..3d8f329 --- /dev/null +++ b/services/nb_car.ml @@ -0,0 +1,15 @@ +(** Service counting the characters in a word *) + +open Ppx_yojson_conv_lib.Yojson_conv.Primitives + +type request = { value : string } [@@deriving yojson] +type response = { value : string; nbcar : int64 } [@@deriving yojson] + +(** The method used in the service *) +let method_ = Services.POST + +type placeholders = unit +(** No placeholder here in the request url *) + +(** The path to the service, matching the type parameters *) +let path = Path.(T1 (Fixed (V_string.v "api/counter"))) |