Add static middleware
This commit is contained in:
parent
b28c20f4e5
commit
2173c47696
|
@ -3,6 +3,7 @@ module Main where
|
||||||
|
|
||||||
import qualified Database.SQLite.Simple as Db
|
import qualified Database.SQLite.Simple as Db
|
||||||
import qualified Web.Spock.Safe as S hiding (head)
|
import qualified Web.Spock.Safe as S hiding (head)
|
||||||
|
import Network.Wai.Middleware.Static
|
||||||
import qualified Within.DBMemorial.Post as Post
|
import qualified Within.DBMemorial.Post as Post
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
@ -15,5 +16,6 @@ main = do
|
||||||
|
|
||||||
-- Set up the URL router
|
-- Set up the URL router
|
||||||
S.runSpock 5000 $ S.spockT id $ do
|
S.runSpock 5000 $ S.spockT id $ do
|
||||||
|
S.middleware (staticPolicy (addBase "public"))
|
||||||
S.get S.root $
|
S.get S.root $
|
||||||
S.text $ Post.body h
|
S.text $ Post.body h
|
||||||
|
|
|
@ -62,6 +62,7 @@ executable time-wasting-thread-memorial
|
||||||
, sqlite-simple >=0.4.9.0
|
, sqlite-simple >=0.4.9.0
|
||||||
, text >=1.2.1.1
|
, text >=1.2.1.1
|
||||||
, blaze-html >=0.8.0.2
|
, blaze-html >=0.8.0.2
|
||||||
|
, wai-middleware-static >=0.7.0.1
|
||||||
|
|
||||||
-- Directories containing source files.
|
-- Directories containing source files.
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
|
|
Loading…
Reference in New Issue