package sihl-web

  1. Overview
  2. Docs
Sihl HTTP service and middlewares

Install

Dune Dependency

Authors

Maintainers

Sources

sihl-0.3.0-rc1.tbz
sha256=ebfeaa62fe4498e6de03d7e6577e10c143d6148a10a6a47b98e032f3dcc70ddc
sha512=e1d80894a4a5a2d99036f6dc0fbd60686a105509fb5b743d5dfa70f4ce76a2ffeac6419bcc1b0da56a631f592497262551a44ec4a004c81809bc08d156008061

doc/src/sihl-web/static.ml.html

Source file static.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
let middleware () =
  let local_path =
    Option.value
      (Sihl_core.Configuration.read_string "PUBLIC_DIR")
      ~default:"./public"
  in
  let internal_uri_prefix =
    Option.value
      (Sihl_core.Configuration.read_string "PUBLIC_URI_PREFIX")
      ~default:"/assets"
  in
  let uri_prefix = Http.externalize_path internal_uri_prefix in
  Opium.Middleware.static_unix ~local_path ~uri_prefix ()
;;
OCaml

Innovation. Community. Security.