diff options
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Main.hs b/src/Main.hs index d69ced6..03709d4 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -11,6 +11,7 @@ import Control.Monad.Trans.Resource (runResourceT) import Control.Monad (when, unless) import Database.Persist.Sqlite import Data.Bool (bool) +import Data.FileEmbed (embedFile) import Data.Function ((&)) import Data.Pool (Pool) import Network.Wai.Handler.Warp hiding (getPort, getHost) @@ -53,20 +54,20 @@ instance YesodPersist Search where runDB action = getYesod >>= runSqlPool action . sqlPool -getHomeR :: Handler () +getHomeR :: Handler TypedContent getHomeR = do cacheSeconds $ 60 * 60 * 24 * 7 - sendFile typeHtml "index.html" + return $ TypedContent typeHtml $ toContent ($(embedFile "build/index.html")) -getBundleR :: Handler () +getBundleR :: Handler TypedContent getBundleR = do cacheSeconds $ 60 * 60 * 24 * 7 - sendFile typeJavascript "bundle.js" + return $ TypedContent typeJavascript $ toContent ($(embedFile "build/bundle.js")) -getStyleR :: Handler () +getStyleR :: Handler TypedContent getStyleR = do cacheSeconds $ 60 * 60 * 24 * 7 - sendFile typeCss "style.css" + return $ TypedContent typeCss $ toContent ($(embedFile "build/style.css")) getBangsR :: Handler TypedContent getBangsR = do |