pellest/src/asset.ml
2022-12-06 00:25:28 +01:00

11 lines
333 B
OCaml

let loader _root path _request =
match Content.read ("assets/" ^ path) with
| None ->
Dream.empty `Not_Found
(* Template.err (`Bad_Request, "file doesn't exist") *)
| Some asset ->
(* TODO cache-control: ~headers:[ ("Cache-Control", "max-age=151200") ] *)
Dream.respond asset
let get = Dream.static ~loader ""