From 2173c476960c676b5f98678411517f191da0f063 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Tue, 28 Jul 2015 01:10:52 -0700 Subject: [PATCH] Add static middleware --- web/src/Main.hs | 2 ++ web/time-wasting-thread-memorial.cabal | 1 + 2 files changed, 3 insertions(+) diff --git a/web/src/Main.hs b/web/src/Main.hs index 28589a3..b62dde8 100644 --- a/web/src/Main.hs +++ b/web/src/Main.hs @@ -3,6 +3,7 @@ module Main where import qualified Database.SQLite.Simple as Db import qualified Web.Spock.Safe as S hiding (head) +import Network.Wai.Middleware.Static import qualified Within.DBMemorial.Post as Post main :: IO () @@ -15,5 +16,6 @@ main = do -- Set up the URL router S.runSpock 5000 $ S.spockT id $ do + S.middleware (staticPolicy (addBase "public")) S.get S.root $ S.text $ Post.body h diff --git a/web/time-wasting-thread-memorial.cabal b/web/time-wasting-thread-memorial.cabal index 64145c3..49035d0 100644 --- a/web/time-wasting-thread-memorial.cabal +++ b/web/time-wasting-thread-memorial.cabal @@ -62,6 +62,7 @@ executable time-wasting-thread-memorial , sqlite-simple >=0.4.9.0 , text >=1.2.1.1 , blaze-html >=0.8.0.2 + , wai-middleware-static >=0.7.0.1 -- Directories containing source files. hs-source-dirs: src