package sihl

  1. Overview
  2. Docs
The Sihl web framework

Install

dune-project
 Dependency

Authors

Maintainers

Sources

3.0.4.tar.gz
md5=8a2754d6e5b9eafb8ff332abdb1ceb7d
sha512=3230a1315686b0b6f90a41ceda27ab036e178184ab13d5a98f64d6d987caf4a8a5d94ed78bc8e79b0ee3b40ccbb1dbdc71ffe171f1aef1f18aba81fc720e3a1b

doc/src/sihl/web_static.ml.html

Source file web_static.ml

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