From 30f786e277b4ece6a09311de364082691f261ca3 Mon Sep 17 00:00:00 2001
From: Joris
Date: Fri, 10 Nov 2017 01:23:49 +0100
Subject: Minify javascript in dist mode, compress served files with gzip

---
 server/src/Main.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'server/src')

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
-- 
cgit v1.2.3