Skip to content

Commit 10b5aea

Browse files
authored
Expand Raw's documentation with example using Tagged (#1832)
1 parent 7a701e9 commit 10b5aea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

servant/src/Servant/API/Raw.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ import Data.Typeable (Typeable)
1010
-- The given 'Application' will get the request as received by the server, potentially with
1111
-- a modified (stripped) 'pathInfo' if the 'Application' is being routed with 'Servant.API.Sub.:>'.
1212
--
13+
-- To plug a Wai 'Application' directly, you must use `Tagged`:
14+
--
15+
-- >>> type API = "foo" :> Get '[JSON] Int :<|> "bar" :> Raw
16+
-- >>>
17+
-- >>> app :: Application
18+
-- >>> app = ...
19+
-- >>>
20+
-- >>> server :: Server API
21+
-- >>> server = pure 42 :<|> Tagged app
22+
--
1323
-- In addition to just letting you plug in your existing WAI 'Application's,
1424
-- this can also be used with functions from
1525
-- <https://hackage.haskell.org/package/servant-server/docs/Servant-Server-StaticFiles.html Servant.Server.StaticFiles>

0 commit comments

Comments
 (0)