rebase master and cleanup
This commit is contained in:
parent
09c397d41d
commit
b17f2dd0e8
3 changed files with 6 additions and 6 deletions
|
@ -41,7 +41,7 @@ import qualified Network.HTTP.Client as C
|
|||
import Network.HTTP.Media
|
||||
import Network.HTTP.Types (Status (..), badRequest400,
|
||||
methodGet, ok200, status400)
|
||||
import Network.Socket
|
||||
import Network.Socket hiding (Raw)
|
||||
import Network.Wai (Application, responseLBS)
|
||||
import Network.Wai.Handler.Warp
|
||||
import System.IO.Unsafe (unsafePerformIO)
|
||||
|
@ -98,8 +98,8 @@ type Api =
|
|||
:<|> "param" :> QueryParam "name" String :> Get '[FormUrlEncoded,JSON] Person
|
||||
:<|> "params" :> QueryParams "names" String :> Get '[JSON] [Person]
|
||||
:<|> "flag" :> QueryFlag "flag" :> Get '[JSON] Bool
|
||||
:<|> "rawSuccess" :> Raw
|
||||
:<|> "rawFailure" :> Raw
|
||||
:<|> "rawSuccess" :> Raw IO Application
|
||||
:<|> "rawFailure" :> Raw IO Application
|
||||
:<|> "multiple" :>
|
||||
Capture "first" String :>
|
||||
QueryParam "second" Int :>
|
||||
|
|
|
@ -239,8 +239,8 @@ instance (KnownSymbol sym, HasForeign sublayout)
|
|||
|
||||
where str = pack . symbolVal $ (Proxy :: Proxy sym)
|
||||
|
||||
instance HasForeign Raw where
|
||||
type Foreign Raw = Method -> Req
|
||||
instance HasForeign (Raw m a) where
|
||||
type Foreign (Raw m a) = Method -> Req
|
||||
|
||||
foreignFor Proxy req method =
|
||||
req & funcName %~ ((toLower method) :)
|
||||
|
|
|
@ -38,7 +38,7 @@ import Servant.API ((:<|>) (..), (:>), Capture, Delete,
|
|||
HttpVersion, IsSecure (..), JSON,
|
||||
Patch, PlainText, Post, Put,
|
||||
QueryFlag, QueryParam, QueryParams,
|
||||
Raw, RemoteHost, ReqBody,
|
||||
Raw(..), RemoteHost, ReqBody,
|
||||
addHeader)
|
||||
import Servant.Server (Server, serve, ServantErr(..), err404)
|
||||
import Test.Hspec (Spec, describe, it, shouldBe)
|
||||
|
|
Loading…
Add table
Reference in a new issue