Explicit imports in /src.
This commit is contained in:
parent
6835f0559a
commit
2f9c6340c4
3 changed files with 22 additions and 19 deletions
|
@ -11,10 +11,12 @@ module Servant.Server
|
|||
HasServer(..)
|
||||
) where
|
||||
|
||||
import Data.Proxy
|
||||
import Network.Wai
|
||||
import Data.Proxy (Proxy)
|
||||
import Network.Wai (Application)
|
||||
|
||||
import Servant.Server.Internal
|
||||
|
||||
|
||||
-- * Implementing Servers
|
||||
|
||||
-- | 'serve' allows you to implement an API and produce a wai 'Application'.
|
||||
|
@ -30,7 +32,7 @@ import Servant.Server.Internal
|
|||
-- > postBook book = ...
|
||||
-- >
|
||||
-- > myApi :: Proxy MyApi
|
||||
-- > myApi = Proxy
|
||||
-- > myApi = Proxy
|
||||
-- >
|
||||
-- > app :: Application
|
||||
-- > app = serve myApi server
|
||||
|
@ -39,4 +41,3 @@ import Servant.Server.Internal
|
|||
-- > main = Network.Wai.Handler.Warp.run 8080 app
|
||||
serve :: HasServer layout => Proxy layout -> Server layout -> Application
|
||||
serve p server = toApplication (route p server)
|
||||
|
||||
|
|
|
@ -7,24 +7,26 @@
|
|||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
module Servant.Server.Internal where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Monad.Trans.Either
|
||||
import Data.Aeson
|
||||
import Control.Applicative ((<$>))
|
||||
import Control.Monad.Trans.Either (EitherT, runEitherT)
|
||||
import Data.Aeson (ToJSON, FromJSON, encode, decode')
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Data.ByteString.Lazy as BL
|
||||
import Data.IORef
|
||||
import Data.IORef (newIORef, readIORef, writeIORef)
|
||||
import Data.Maybe (catMaybes)
|
||||
import Data.Monoid
|
||||
import Data.Proxy
|
||||
import Data.String
|
||||
import Data.String.Conversions
|
||||
import Data.Monoid (Monoid, mempty, mappend)
|
||||
import Data.Proxy (Proxy(Proxy))
|
||||
import Data.String (fromString)
|
||||
import Data.String.Conversions (cs, (<>))
|
||||
import Data.Text.Encoding (decodeUtf8)
|
||||
import Data.Text (Text)
|
||||
import GHC.TypeLits
|
||||
import GHC.TypeLits (KnownSymbol, symbolVal)
|
||||
import Network.HTTP.Types hiding (Header)
|
||||
import Network.Wai
|
||||
import Servant.API
|
||||
import Servant.Common.Text
|
||||
import Network.Wai (Response, Request, ResponseReceived, Application, pathInfo, requestBody,
|
||||
strictRequestBody, lazyRequestBody, requestHeaders, requestMethod,
|
||||
rawQueryString, responseLBS)
|
||||
import Servant.API (QueryParams, QueryParam, QueryFlag, ReqBody, Header, Capture, Get, Delete, Put, Post, Raw, (:>), (:<|>)(..))
|
||||
import Servant.Common.Text (FromText, fromText)
|
||||
|
||||
data ReqBodyState = Uncalled
|
||||
| Called !B.ByteString
|
||||
|
|
|
@ -7,9 +7,9 @@ module Servant.Utils.StaticFiles (
|
|||
) where
|
||||
|
||||
import Filesystem.Path.CurrentOS (decodeString)
|
||||
import Network.Wai.Application.Static
|
||||
import Servant.API.Raw
|
||||
import Servant.Server.Internal
|
||||
import Network.Wai.Application.Static (staticApp, defaultFileServerSettings)
|
||||
import Servant.API.Raw (Raw)
|
||||
import Servant.Server.Internal (Server)
|
||||
|
||||
-- | Serve anything under the specified directory as a 'Raw' endpoint.
|
||||
--
|
||||
|
|
Loading…
Reference in a new issue