1{-# LANGUAGE InstanceSigs #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE TypeFamilies #-}
4module Servant.API.Raw where
6import Control.Monad.Trans.Either
7import Data.ByteString.Lazy
9import Network.HTTP.Types
12import Servant.Common.BaseUrl
13import Servant.Common.Req
14import Servant.Docs hiding (Method)
17-- | Endpoint for plugging in your own Wai 'Application's.
19-- The given 'Application' will get the request as received by the server, potentially with
20-- a modified (stripped) 'pathInfo' if the 'Application' is being routed with 'Servant.API.Sub.:>'.
23instance HasServer Raw where
24 type Server Raw = Application
25 route Proxy rawApplication request respond =
26 rawApplication request (respond . succeedWith)
28instance HasClient Raw where
29 type Client Raw = Method -> BaseUrl -> EitherT String IO (Int, ByteString)
31 clientWithRoute :: Proxy Raw -> Req -> Client Raw
32 clientWithRoute Proxy req method host =
33 performRequest method req (const True) host
36instance HasDocs Raw where
37 docsFor _proxy (endpoint, action) =
38 single endpoint action
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list