@@ -63,10 +63,11 @@ import Obelisk.Backend
6363
6464run
6565 :: Int -- ^ Port to run the backend
66+ -> FilePath -- ^ Path where the static assets live
6667 -> Backend fullRoute frontendRoute -- ^ Backend
6768 -> Frontend (R frontendRoute) -- ^ Frontend
6869 -> IO ()
69−run port backend frontend = do
70+run port assetsPath backend frontend = do
7071 prettifyOutput
7172 let handleBackendErr (e :: IOException) = hPutStrLn stderr $ "backend stopped; make a change to your code to reload - error " <> show e
7273 --TODO: Use Obelisk.Backend.runBackend; this will require separating the checking and running phases
@@ -79,9 +80,14 @@ run port backend frontend = do
7980 getRouteWith validFullEncoder >>= \case
8081 Identity r -> case r of
8182 InL backendRoute :=> Identity a -> serveRoute $ backendRoute :/ a
82− InR obeliskRoute :=> Identity a -> serveDefaultObeliskApp frontend $ obeliskRoute :/ a
83+ InR obeliskRoute :=> Identity a -> serveDefaultObeliskApp' staticAssets frontend $ obeliskRoute :/ a
8384 let conf = defRunConfig { _runConfig_redirectPort = port }
8485 runWidget conf frontend validFullEncoder `finally` killThread backendTid
86+ where
87+ staticAssets = StaticAssets
88+ { _staticAssets_processed = assetsPath <> ".assets"
89+ , _staticAssets_unprocessed = assetsPath
90+ }
8591
8692getConfigRoute :: IO (Maybe URI)
8793getConfigRoute = get "config/common/route" >>= \case