Export toApplication
from Server.
This commit is contained in:
parent
cae0b6e252
commit
1a63d8797a
1 changed files with 9 additions and 2 deletions
|
@ -4,12 +4,14 @@
|
||||||
-- | This module lets you implement 'Server's for defined APIs. You'll
|
-- | This module lets you implement 'Server's for defined APIs. You'll
|
||||||
-- most likely just need 'serve'.
|
-- most likely just need 'serve'.
|
||||||
module Servant.Server
|
module Servant.Server
|
||||||
( -- * Implementing an API
|
( -- * Run a wai application from an API
|
||||||
serve
|
serve
|
||||||
|
|
||||||
|
, -- * Construct a wai Application from an API
|
||||||
|
toApplication
|
||||||
|
|
||||||
, -- * Handlers for all standard combinators
|
, -- * Handlers for all standard combinators
|
||||||
HasServer(..)
|
HasServer(..)
|
||||||
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Proxy (Proxy)
|
import Data.Proxy (Proxy)
|
||||||
|
@ -40,5 +42,10 @@ import Servant.Server.Internal
|
||||||
-- >
|
-- >
|
||||||
-- > main :: IO ()
|
-- > main :: IO ()
|
||||||
-- > main = Network.Wai.Handler.Warp.run 8080 app
|
-- > main = Network.Wai.Handler.Warp.run 8080 app
|
||||||
|
--
|
||||||
|
-- (If you need access to the wai 'Application' type, use
|
||||||
|
-- 'toApplication'. This is useful for writing custom servers that do
|
||||||
|
-- things other than routing (e.g. dumping all requests and responses
|
||||||
|
-- to a file).)
|
||||||
serve :: HasServer layout => Proxy layout -> Server layout -> Application
|
serve :: HasServer layout => Proxy layout -> Server layout -> Application
|
||||||
serve p server = toApplication (route p server)
|
serve p server = toApplication (route p server)
|
||||||
|
|
Loading…
Reference in a new issue