clean code

This commit is contained in:
zapashcanon 2022-12-06 00:12:14 +01:00
parent 97864116bb
commit 20f18bcd76
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
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 ""