Unverified Commit 37b7d326 authored by zapashcanon's avatar zapashcanon
Browse files

fmt

parent 280e96ab
......@@ -19,42 +19,48 @@ let () =
match page "index" with
| None -> Dream.empty `Not_Found
| Some content ->
Dream.html
(Template.render_unsafe ~title:"title" ~content) )
Dream.html (Template.render_unsafe ~title:"title" ~content) )
; Dream.get "/badge" (fun request ->
Dream.respond ~headers:["Content-Type", "image/svg+xml"] (
let open Ocb in
let label = match Dream.query "label" request with
| None -> "Label"
| Some label -> label
in
let color = match Dream.query "color" request with
| None -> Color.Blue
| Some color -> Color.of_string color
in
let style = match Dream.query "style" request with
| None -> Style.Flat
| Some style -> Style.of_string style
in
let label_color = match Dream.query "label_color" request with
| None -> Color.Black
| Some label_color -> Color.of_string label_color
in
let status = match Dream.query "status" request with
| None -> "Status"
| Some status -> status
in
let scale = match Dream.query "scale" request with
| None -> 1.
| Some scale -> begin match float_of_string_opt scale with
| None -> 1.
| Some scale -> scale
end
in
Format.asprintf "%a" (
Gen.mk ~label ~color ~style ~label_color ~status ~icon:None ~icon_width:0. ~scale
) ()
)
)
Dream.respond
~headers:[ ("Content-Type", "image/svg+xml") ]
(let open Ocb in
let label =
match Dream.query "label" request with
| None -> "Label"
| Some label -> label
in
let color =
match Dream.query "color" request with
| None -> Color.Blue
| Some color -> Color.of_string color
in
let style =
match Dream.query "style" request with
| None -> Style.Flat
| Some style -> Style.of_string style
in
let label_color =
match Dream.query "label_color" request with
| None -> Color.Black
| Some label_color -> Color.of_string label_color
in
let status =
match Dream.query "status" request with
| None -> "Status"
| Some status -> status
in
let scale =
match Dream.query "scale" request with
| None -> 1.
| Some scale -> begin
match float_of_string_opt scale with
| None -> 1.
| Some scale -> scale
end
in
Format.asprintf "%a"
(Gen.mk ~label ~color ~style ~label_color ~status ~icon:None
~icon_width:0. ~scale )
()) )
]
@@ Dream.not_found
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment