on master help sign in
Serve static assets and frontend.jsexe separately
commit3db6a57b86b667e3883c2edf0ec4b8886efc7bae authorRyan Trinkle <ryan.trinkle@gmail.com> dateSat 30 Dec 2017, 15:32 (9 years ago) parent8153ea7
1 file changed+6−2
backend/src/Obelisk/Backend.hs+6−2
backend/src/Obelisk/Backend.hs+6−2
@@ -1,3 +1,4 @@
1+{-# LANGUAGE OverloadedStrings #-}
12module Obelisk.Backend
23 ( backend
34 , BackendConfig
@@ -9,7 +10,7 @@ import qualified Data.ByteString.Char8 as BSC8
910import Data.Default (Default (..))
1011import Obelisk.Asset.Serve (serveAssets)
1112import System.IO (hSetBuffering, stderr, BufferMode (..))
12−import Snap (httpServe, defaultConfig, commandLineConfig)
13+import Snap (httpServe, defaultConfig, commandLineConfig, route)
1314import Snap.Internal.Http.Server.Config (Config (accessLog, errorLog), ConfigLog (ConfigIoLog))
1415
1516--TODO: Add a link to a large explanation of the idea of using 'def'
@@ -34,4 +35,7 @@ backend _ = do
3435 , errorLog = Just $ ConfigIoLog BSC8.putStrLn
3536 }
3637 -- Start the web server
37− httpServe httpConf $ serveAssets "static.assets" "static"
38+ httpServe httpConf $ route
39+ [ ("", serveAssets "frontend.jsexe.assets" "frontend.jsexe")
40+ , ("", serveAssets "static.assets" "static")
41+ ]