on master help sign in
Add serveDefaultObeliskApp' which allows specifying the assets path
commit2b3907eb80c3386736f945e191bdef2afda5209f authorLuigy Leon <luichi.19@gmail.com> dateThu 11 Oct 2018, 13:52 (8 years ago) parent92ab57b
1 file changed+6−1
lib/backend/src/Obelisk/Backend.hs+6−1
lib/backend/src/Obelisk/Backend.hs+6−1
@@ -8,6 +8,8 @@
88{-# LANGUAGE TemplateHaskell #-}
99module Obelisk.Backend
1010 ( Backend (..)
11+ , StaticAssets (..)
12+ , serveDefaultObeliskApp'
1113 -- * Re-exports
1214 , Default (def)
1315 , getPageName
@@ -56,7 +58,10 @@ data GhcjsApp route = GhcjsApp
5658-- | Serve a frontend, which must be the same frontend that Obelisk has built and placed in the default location
5759--TODO: The frontend should be provided together with the asset paths so that this isn't so easily breakable; that will probably make this function obsolete
5860serveDefaultObeliskApp :: MonadSnap m => Frontend (R appRoute) -> R (ObeliskRoute appRoute) -> m ()
59−serveDefaultObeliskApp frontend = serveObeliskApp defaultStaticAssets frontendApp
61+serveDefaultObeliskApp = serveDefaultObeliskApp' defaultStaticAssets
62+
63+serveDefaultObeliskApp' :: MonadSnap m => StaticAssets -> Frontend (R appRoute) -> R (ObeliskRoute appRoute) -> m ()
64+serveDefaultObeliskApp' staticAssets frontend = serveObeliskApp staticAssets frontendApp
6065 where frontendApp = GhcjsApp
6166 { _ghcjsApp_compiled = defaultFrontendGhcjsAssets
6267 , _ghcjsApp_value = frontend