aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/server.cabal1
-rw-r--r--server/src/Main.hs5
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