mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-16 15:56:15 -05:00
Compare commits
4 commits
fa572155cc
...
5e70b0f664
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e70b0f664 | ||
|
|
1f60d6165d | ||
|
|
55eb9c2a2f | ||
|
|
92999d56e8 |
4 changed files with 8 additions and 6 deletions
4
.github/workflows/gh-pages.yml
vendored
4
.github/workflows/gh-pages.yml
vendored
|
|
@ -13,9 +13,9 @@ jobs:
|
|||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use OCaml
|
||||
uses: ocaml/setup-ocaml@v2
|
||||
uses: ocaml/setup-ocaml@v3
|
||||
with:
|
||||
ocaml-compiler: 5.1.x
|
||||
ocaml-compiler: 5.03.x
|
||||
dune-cache: true
|
||||
allow-prerelease-opam: true
|
||||
|
||||
|
|
|
|||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
ocaml-compiler:
|
||||
- 4.08.x
|
||||
- 4.14.x
|
||||
- 5.01.x
|
||||
- 5.03.x
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ jobs:
|
|||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
|
||||
- name: Use OCaml ${{ matrix.ocaml-compiler }}
|
||||
uses: ocaml/setup-ocaml@v2
|
||||
uses: ocaml/setup-ocaml@v3
|
||||
with:
|
||||
ocaml-compiler: ${{ matrix.ocaml-compiler }}
|
||||
allow-prerelease-opam: true
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ val rest_of_path : (string -> 'a, 'a) t
|
|||
@since 0.7 *)
|
||||
|
||||
val rest_of_path_urlencoded : (string -> 'a, 'a) t
|
||||
(** Matches a string, even containing ['/'], an URL-decode it.
|
||||
(** Matches a string, even containing ['/'], and URL-decode it (piecewise).
|
||||
This will match the entirety of the remaining route.
|
||||
@since 0.7 *)
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,9 @@ let add_route_to_server (server : Server.t) (reg : registry) : unit =
|
|||
Server.add_route_handler server Route.(exact "metrics" @/ return)
|
||||
@@ fun _req ->
|
||||
let str = Registry.emit_str reg in
|
||||
Response.make_string @@ Ok str
|
||||
(* https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format *)
|
||||
let headers = [ "content-type", "text/plain; version=0.0.4" ] in
|
||||
Response.make_string ~headers @@ Ok str
|
||||
|
||||
let instrument_server (server : Server.t) reg : unit =
|
||||
Server.add_middleware ~stage:(`Stage 1) server (http_middleware reg);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue