diff --git a/app/Main.hs b/app/Main.hs index cc78955..9e2550f 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -73,6 +73,7 @@ data ConfigT f = Config { yorePort :: f =@@ Int ? 3000 , yoreDownloadDir :: f =@@ FilePath ? "./download" , yoreDb :: f =@! Text + , yoreStaticDir :: f =@@ FilePath ? "./static" } deriving (Generic) @@ -206,7 +207,7 @@ server cfg db = rootR :<|> todayR :<|> staticR :<|> apiTodayR dayFile <- DB.withConn db $ DB.getDayFileByIssue dateThen issue pure $ RootModel dateThen dayFile issue count - staticR = serveDirectoryWebApp "static" + staticR = serveDirectoryWebApp cfg.yoreStaticDir apiTodayR issue = do dateThen <- getTodayWithOffset (-100) 0 diff --git a/flake.nix b/flake.nix index efc54f7..530ea20 100644 --- a/flake.nix +++ b/flake.nix @@ -85,7 +85,8 @@ chmod +w -R "''${TMPDIR}" rm -rf "''${TMPDIR}" - cp -r ${./static} static + echo ${./static} + export YORE_STATIC_DIR=${./static} # Replace bash and inherit PID 1 cd /