From 3f454ad0d2a0b0990a1029871e32f1b72c98bb1e Mon Sep 17 00:00:00 2001 From: Brandon Martin Date: Fri, 31 Jul 2015 11:21:28 -0600 Subject: [PATCH] Finish changes for Raw now works with Enter --- servant-client/CHANGELOG.md | 2 +- servant-docs/CHANGELOG.md | 2 +- servant-examples/socket-io-chat/socket-io-chat.hs | 2 +- servant-examples/tutorial/T10.hs | 6 +++--- servant-mock/CHANGELOG.md | 0 servant-server/CHANGELOG.md | 6 +++++- servant-server/src/Servant/Utils/StaticFiles.hs | 4 ++-- servant/CHANGELOG.md | 2 +- 8 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 servant-mock/CHANGELOG.md diff --git a/servant-client/CHANGELOG.md b/servant-client/CHANGELOG.md index 29398d95..5698aa19 100644 --- a/servant-client/CHANGELOG.md +++ b/servant-client/CHANGELOG.md @@ -1,6 +1,6 @@ HEAD ---- - +* Update `instance HasClient Raw` for servant Raw changes * Support for the `HttpVersion`, `IsSecure`, `RemoteHost` and `Vault` combinators * Added support for `path` on `BaseUrl`. * `client` now takes an explicit `Manager` argument. diff --git a/servant-docs/CHANGELOG.md b/servant-docs/CHANGELOG.md index d42daed7..4ae611c6 100644 --- a/servant-docs/CHANGELOG.md +++ b/servant-docs/CHANGELOG.md @@ -1,6 +1,6 @@ HEAD ---- - +* Update `instance HasDocs Raw` for servant Raw changes * Support for the `HttpVersion`, `IsSecure`, `RemoteHost` and `Vault` combinators * Support maximum samples setting with new `DocOptions` type (used by `docsWithOptions` and `docsWith`) * Remove redundant second parameter of ToSample diff --git a/servant-examples/socket-io-chat/socket-io-chat.hs b/servant-examples/socket-io-chat/socket-io-chat.hs index d5c5f4f0..600ba998 100644 --- a/servant-examples/socket-io-chat/socket-io-chat.hs +++ b/servant-examples/socket-io-chat/socket-io-chat.hs @@ -34,7 +34,7 @@ server sHandler = socketIOHandler :<|> serveDirectory "socket-io-chat/resources" where - socketIOHandler req respond = toWaiApplication sHandler req respond + socketIOHandler = Raw $ toWaiApplication sHandler app :: WaiMonad () -> Application diff --git a/servant-examples/tutorial/T10.hs b/servant-examples/tutorial/T10.hs index 234298bb..ca78d737 100644 --- a/servant-examples/tutorial/T10.hs +++ b/servant-examples/tutorial/T10.hs @@ -15,7 +15,7 @@ import Servant import Servant.Docs import qualified T3 -type DocsAPI = T3.API :<|> Raw Apllication IO +type DocsAPI = T3.API :<|> Raw Application IO instance ToCapture (Capture "x" Int) where toCapture _ = DocCapture "x" "(integer) position on the x axis" @@ -62,8 +62,8 @@ docsBS = encodeUtf8 server :: Server DocsAPI server = T3.server :<|> serveDocs - where serveDocs _ respond = - respond $ responseLBS ok200 [plain] docsBS + where serveDocs = Raw (\_ respond -> + respond $ responseLBS ok200 [plain] docsBS) plain = ("Content-Type", "text/plain") diff --git a/servant-mock/CHANGELOG.md b/servant-mock/CHANGELOG.md new file mode 100644 index 00000000..e69de29b diff --git a/servant-server/CHANGELOG.md b/servant-server/CHANGELOG.md index bbc54235..0cda2a06 100644 --- a/servant-server/CHANGELOG.md +++ b/servant-server/CHANGELOG.md @@ -1,6 +1,10 @@ HEAD ---- - +* Add `serveDirectoryWith` user can supply custom `StaticSettings` +* Update `serveDirectory` for servant Raw changes +* Add `class ToRawApplication` for servant Raw changes +* Update `instance Server Raw` for servant Raw changes +* Add `instance Enter Raw` for servant Raw changes * Support for the `HttpVersion`, `IsSecure`, `RemoteHost` and `Vault` combinators * Drop `EitherT` in favor of `ExceptT` diff --git a/servant-server/src/Servant/Utils/StaticFiles.hs b/servant-server/src/Servant/Utils/StaticFiles.hs index 4ae2e1d7..c0767ebc 100644 --- a/servant-server/src/Servant/Utils/StaticFiles.hs +++ b/servant-server/src/Servant/Utils/StaticFiles.hs @@ -38,10 +38,10 @@ import Filesystem.Path.CurrentOS (decodeString) -- behind a /\/static\// prefix. In that case, remember to put the 'serveDirectory' -- handler in the last position, because /servant/ will try to match the handlers -- in order. -serveDirectoryWith :: StaticSettings -> Server (Raw Application m) +serveDirectoryWith :: StaticSettings -> ServerT (Raw Application m) n serveDirectoryWith settings = Raw (staticApp settings) -serveDirectory :: FilePath -> Server (Raw Application m) +serveDirectory :: FilePath -> ServerT (Raw Application m) n serveDirectory = serveDirectoryWith . defaultFileServerSettings . #if MIN_VERSION_wai_app_static(3,1,0) id . diff --git a/servant/CHANGELOG.md b/servant/CHANGELOG.md index 043320ae..2cd00ab9 100644 --- a/servant/CHANGELOG.md +++ b/servant/CHANGELOG.md @@ -1,6 +1,6 @@ HEAD ---- - +* Change Raw from `data Raw ...` to `newtype Raw a (m :: * -> *) = Raw a ...` * Add `HttpVersion`, `IsSecure`, `RemoteHost` and `Vault` combinators * Fix safeLink, so Header is not in fact required. * Added more instances for (:<|>)