Add YORE_STATIC_DIR for wiring static directory
This commit is contained in:
parent
799cd1c938
commit
de11a86285
@ -73,6 +73,7 @@ data ConfigT f = Config
|
|||||||
{ yorePort :: f =@@ Int ? 3000
|
{ yorePort :: f =@@ Int ? 3000
|
||||||
, yoreDownloadDir :: f =@@ FilePath ? "./download"
|
, yoreDownloadDir :: f =@@ FilePath ? "./download"
|
||||||
, yoreDb :: f =@! Text
|
, yoreDb :: f =@! Text
|
||||||
|
, yoreStaticDir :: f =@@ FilePath ? "./static"
|
||||||
}
|
}
|
||||||
deriving (Generic)
|
deriving (Generic)
|
||||||
|
|
||||||
@ -206,7 +207,7 @@ server cfg db = rootR :<|> todayR :<|> staticR :<|> apiTodayR
|
|||||||
dayFile <- DB.withConn db $ DB.getDayFileByIssue dateThen issue
|
dayFile <- DB.withConn db $ DB.getDayFileByIssue dateThen issue
|
||||||
pure $ RootModel dateThen dayFile issue count
|
pure $ RootModel dateThen dayFile issue count
|
||||||
|
|
||||||
staticR = serveDirectoryWebApp "static"
|
staticR = serveDirectoryWebApp cfg.yoreStaticDir
|
||||||
|
|
||||||
apiTodayR issue = do
|
apiTodayR issue = do
|
||||||
dateThen <- getTodayWithOffset (-100) 0
|
dateThen <- getTodayWithOffset (-100) 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user