From a0bf4807a024788f5473df7e5b060e2bbc1fc07e Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Fri, 13 Jan 2017 23:21:56 +0100 Subject: [PATCH] Use API exported by Spock-core (fix issue #1) --- breve.cabal | 2 +- src/Application.hs | 4 ++-- src/Main.hs | 4 ++-- src/Views.hs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/breve.cabal b/breve.cabal index 8091fe2..aa4a114 100644 --- a/breve.cabal +++ b/breve.cabal @@ -30,7 +30,7 @@ executable breve Breve.Generator, Breve.UrlTable other-extensions: OverloadedStrings build-depends: base >=4.8 && <5.0, warp, warp-tls, tls, - Spock, blaze-html, http-types, + Spock, Spock-core, blaze-html, http-types, wai, wai-middleware-static, wai-extra, transformers, mtl, text, aeson, bytestring, binary, diff --git a/src/Application.hs b/src/Application.hs index da82087..131ed53 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -12,7 +12,7 @@ import Data.Aeson hiding (json) import Data.Text (Text) import qualified Data.Text.IO as T -import Web.Spock.Safe +import Web.Spock.Core import Network.HTTP.Types.Status import Network.Wai (Middleware) import Network.Wai.Middleware.Static @@ -76,4 +76,4 @@ toTLS :: Text -> SpockT IO () toTLS host = do get var (redirect . new) get "/" (redirect $ new "") - where new url = "https://" <> host <> "/" <> url \ No newline at end of file + where new url = "https://" <> host <> "/" <> url diff --git a/src/Main.hs b/src/Main.hs index d95f5f7..168b805 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -8,7 +8,7 @@ import Data.Text (Text, unpack) import Control.Concurrent (forkIO) import Control.Monad -import Web.Spock.Safe +import Web.Spock.Core import Network.Wai.Handler.WarpTLS (runTLS, TLSSettings) import Network.Wai.Handler.Warp (run, defaultSettings, setPort) @@ -34,4 +34,4 @@ main = do when (bindPort == 443) (forkIO' $ runTLSRedirect bindHost) putStrLn ("Serving on " ++ unpack bindUrl) - runBreve tlsSettings bindPort (app bindUrl table) \ No newline at end of file + runBreve tlsSettings bindPort (app bindUrl table) diff --git a/src/Views.hs b/src/Views.hs index e4fbbd0..c1a879c 100644 --- a/src/Views.hs +++ b/src/Views.hs @@ -7,7 +7,7 @@ import Data.Text.Lazy (toStrict) import Text.Blaze.Html.Renderer.Text (renderHtml) import Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes as A -import qualified Web.Spock.Safe as S +import qualified Web.Spock.Core as S render :: Html -> S.ActionT IO () render = S.html . toStrict . renderHtml