diff options
author | Joris | 2017-11-10 01:23:49 +0100 |
---|---|---|
committer | Joris | 2017-11-10 01:23:49 +0100 |
commit | 30f786e277b4ece6a09311de364082691f261ca3 (patch) | |
tree | 4604e6714baeb3d653b8fdce99725c0acecd1633 /server | |
parent | 27e11b20b06f2f2dbfb56c0998a63169b4b8abc4 (diff) |
Minify javascript in dist mode, compress served files with gzip
Diffstat (limited to 'server')
-rw-r--r-- | server/server.cabal | 1 | ||||
-rw-r--r-- | server/src/Main.hs | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/server/server.cabal b/server/server.cabal index 2e1f7be..8bbe5f2 100644 --- a/server/server.cabal +++ b/server/server.cabal @@ -42,6 +42,7 @@ executable server , unordered-containers , uuid , wai + , wai-extra , wai-middleware-static hs-source-dirs: src default-language: Haskell2010 diff --git a/server/src/Main.hs b/server/src/Main.hs index db73474..96c13ee 100644 --- a/server/src/Main.hs +++ b/server/src/Main.hs @@ -3,8 +3,10 @@ import Control.Applicative (liftA3) import Control.Monad.IO.Class (liftIO) -import Network.Wai.Middleware.Static import qualified Data.Text.Lazy as LT +import Network.Wai.Middleware.Gzip (GzipFiles(GzipCompress)) +import qualified Network.Wai.Middleware.Gzip as W +import Network.Wai.Middleware.Static import Web.Scotty import qualified Conf @@ -26,6 +28,7 @@ main = do conf <- Conf.get "application.conf" _ <- runDaemons conf scotty (Conf.port conf) $ do + middleware $ W.gzip $ W.def { W.gzipFiles = GzipCompress } middleware . staticPolicy $ noDots >-> addBase "public" get "/exceedingPayer" $ do |