Make example/4-counter a bit nicer

This commit is contained in:
Anton Bachin 2021-04-05 00:57:34 +03:00
parent 49772fb9f8
commit 76a8d6c06a
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@
This example shows how easy it is to define a custom middleware,
`count_requests`. It exposes the request count at
[http://localhost:8080/dashboard](http://localhost:8080/dashboard):
[http://localhost:8080/](http://localhost:8080/) in a sort of dashboard:
```ocaml
let count = ref 0
@ -18,7 +18,7 @@ let () =
@@ Dream.logger
@@ count_requests
@@ Dream.router [
Dream.get "/dashboard" (fun _ ->
Dream.get "/" (fun _ ->
Dream.respond (Printf.sprintf "Saw %i request(s)!" !count));
]
@@ Dream.not_found

View File

@ -9,7 +9,7 @@ let () =
@@ Dream.logger
@@ count_requests
@@ Dream.router [
Dream.get "/dashboard" (fun _ ->
Dream.get "/" (fun _ ->
Dream.respond (Printf.sprintf "Saw %i request(s)!" !count));
]
@@ Dream.not_found