aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/main.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/main.ml b/bin/main.ml
index 49469a3..45bd973 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -67,6 +67,11 @@ let actor_allowlist =
"https://graphics.social/users/theohonohan";
]
+let loader _root path _request =
+ match Assets.read path with
+ | None -> Dream.empty `Not_Found
+ | Some asset -> Dream.respond asset
+
let () =
let port =
Sys.getenv_opt "PORT" |> Option.map int_of_string
@@ -84,7 +89,7 @@ let () =
Dream.run ~port ~interface @@ Dream.logger
@@ Dream.router
[
- Dream.get "/static/**" (Dream.static "./assets");
+ Dream.get "/static/**" (Dream.static ~loader "");
Dream.get "/feed.xml" (fun _ ->
let posts = Post.get_all () in
let maybe_latest_post = Post.latest_post () in