package sihl
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
The Sihl web framework
Install
dune-project
Dependency
Authors
Maintainers
Sources
2.0.1.tar.gz
md5=52b28d3faac0a2243735285aa3f962aa
sha512=e7ff89bdba9f1afa3b115a056ae3d403f602685187a968485ea64a7cd1a18791f66b7480b682bf66acd3564dd89139162779d58a43c2389d785c98e246094a18
doc/src/sihl/web_trailing_slash.ml.html
Source file web_trailing_slash.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23let middleware () = let filter handler req = let root_uri = Core_configuration.read_string "PREFIX_PATH" |> CCOpt.value ~default:"" |> Format.asprintf "%s/" |> Uri.of_string in let uri = req.Opium.Request.target |> Uri.of_string in let uri = uri |> Uri.path |> (fun path -> if Uri.equal root_uri uri then path (* don't drop root *) else path |> CCString.rdrop_while (Char.equal '/')) |> Uri.with_path uri in let req = Opium.Request.{ req with target = Uri.to_string uri } in handler req in Rock.Middleware.create ~name:"trailing_slash" ~filter ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>