git.iko.soy/typeable/servant
on master help sign in
Export `toApplication` from Server.
commit1a63d8797a1d948c883049f82fb6b09cf9f01cc3 authorMatthias Fischmann <mf@zerobuzz.net> dateTue 24 Feb 2015, 13:46 (12 years ago) parentcae0b6e
1 file changed+9−2
src/Servant/Server.hs+9−2
src/Servant/Server.hs+9−2
@@ -4,12 +4,14 @@
44-- | This module lets you implement 'Server's for defined APIs. You'll
55-- most likely just need 'serve'.
66module Servant.Server
7− ( -- * Implementing an API
7+ ( -- * Run a wai application from an API
88 serve
99
10+ , -- * Construct a wai Application from an API
11+ toApplication
12+
1013 , -- * Handlers for all standard combinators
1114 HasServer(..)
12−
1315 ) where
1416
1517import Data.Proxy (Proxy)
@@ -40,5 +42,10 @@ import Servant.Server.Internal
4042-- >
4143-- > main :: IO ()
4244-- > main = Network.Wai.Handler.Warp.run 8080 app
45+--
46+-- (If you need access to the wai 'Application' type, use
47+-- 'toApplication'. This is useful for writing custom servers that do
48+-- things other than routing (e.g. dumping all requests and responses
49+-- to a file).)
4350serve :: HasServer layout => Proxy layout -> Server layout -> Application
4451serve p server = toApplication (route p server)