clean code
This commit is contained in:
parent
5ec03d06c2
commit
ee626ccd61
24 changed files with 99 additions and 894 deletions
10
src/asset.ml
Normal file
10
src/asset.ml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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 ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue