+ todo nice routes typing
This commit is contained in:
parent
a5e132dc1b
commit
7f5956d96c
1 changed files with 4 additions and 2 deletions
|
|
@ -20,6 +20,9 @@ let hello req _server _env =
|
||||||
let* () = add ~field:"content-type" "text/plain" in
|
let* () = add ~field:"content-type" "text/plain" in
|
||||||
respond `OK
|
respond `OK
|
||||||
|
|
||||||
|
(* TODO nice routes typing
|
||||||
|
to enforce json verification
|
||||||
|
to specify handlers responses data and status codes *)
|
||||||
let routes =
|
let routes =
|
||||||
let open Vifu.Uri in
|
let open Vifu.Uri in
|
||||||
let open Vifu.Route in
|
let open Vifu.Route in
|
||||||
|
|
@ -76,8 +79,7 @@ let () =
|
||||||
let storage = Mkernel.block "storage" in
|
let storage = Mkernel.block "storage" in
|
||||||
let service =
|
let service =
|
||||||
let ipv4 = Ipaddr.V4.Prefix.of_string_exn "10.0.0.2/24" in
|
let ipv4 = Ipaddr.V4.Prefix.of_string_exn "10.0.0.2/24" in
|
||||||
Mnet.stack ~name:"service"
|
Mnet.stack ~name:"service" ipv4
|
||||||
ipv4
|
|
||||||
in
|
in
|
||||||
Mkernel.(run [ rng; storage; service ])
|
Mkernel.(run [ rng; storage; service ])
|
||||||
@@ fun rng storage (stack, tcp, udp) () ->
|
@@ fun rng storage (stack, tcp, udp) () ->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue