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/src | |
parent | 27e11b20b06f2f2dbfb56c0998a63169b4b8abc4 (diff) |
Minify javascript in dist mode, compress served files with gzip
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/Main.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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 |