on master help sign in
roboservant/test/Nested.hs
23 lines 436 B history raw
1{-# LANGUAGE DataKinds #-}
3{-# LANGUAGE DerivingStrategies #-}
5{-# LANGUAGE OverloadedStrings #-}
6{-# LANGUAGE TypeOperators #-}
8module Nested where
10import Servant
11import Servant.API.Flatten
13type Api =
14 ( "one" :> Summary "foo" :> Post '[JSON] Int
15 :<|> "two" :> Post '[JSON] Int
16 )
17 :<|> ( "three" :> Post '[JSON] Int
18 )
20type FlatApi = Flat Api
22server :: Server FlatApi
23server = pure 1 :<|> pure 2 :<|> pure 3