diff options
Diffstat (limited to 'src/Application.hs')
-rw-r--r-- | src/Application.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Application.hs b/src/Application.hs index 64f8dab..bdedd5e 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -28,6 +28,7 @@ import System.IO (stderr) import Web.Scotty (ScottyM, ActionM, middleware, json, file, addroute, get, delete, status, text, param, scottyApp) import qualified Data.HashMap.Lazy as HM +import qualified Network.Wai.Middleware.Gzip as Gzip import LogFormat (logFormat) @@ -43,6 +44,8 @@ myProcess :: Pools -> Middleware -> FilePath -> ScottyM () myProcess ps logger dataDir = do middleware logger + middleware $ Gzip.gzip Gzip.def {Gzip.gzipFiles = Gzip.GzipCompress} + middleware $ staticPolicy (hasPrefix "static" >-> addBase dataDir) get "/" $ file (dataDir ++ "/" ++ "index.html") |