clean code

This commit is contained in:
pena 2022-12-06 00:12:14 +01:00 committed by Swrup
parent 5ec03d06c2
commit ee626ccd61
24 changed files with 99 additions and 894 deletions

10
src/asset.ml Normal file
View 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 ""