From 1a63d8797a1d948c883049f82fb6b09cf9f01cc3 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Tue, 24 Feb 2015 13:46:50 +0100 Subject: [PATCH] Export `toApplication` from Server. --- src/Servant/Server.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Servant/Server.hs b/src/Servant/Server.hs index 4f8c94a8..ec7efbd6 100644 --- a/src/Servant/Server.hs +++ b/src/Servant/Server.hs @@ -4,12 +4,14 @@ -- | This module lets you implement 'Server's for defined APIs. You'll -- most likely just need 'serve'. module Servant.Server - ( -- * Implementing an API + ( -- * Run a wai application from an API serve + , -- * Construct a wai Application from an API + toApplication + , -- * Handlers for all standard combinators HasServer(..) - ) where import Data.Proxy (Proxy) @@ -40,5 +42,10 @@ import Servant.Server.Internal -- > -- > main :: IO () -- > 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 p server = toApplication (route p server)