about summary refs log blame commit diff
path: root/src/API.hs
blob: a42bf804b471add4b66e6e6a72fa969b1c104260 (plain) (tree)
1
2
3
4
5
6
7
8
9
                          
                              


                                                                                
                
                  
 
                           

                                                                                
                 
                                       
                                            

                                 
                                            

                                    
                                    


                                  
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
--------------------------------------------------------------------------------
module API where
--------------------------------------------------------------------------------
import Data.Text
import Servant.API

import qualified Types as T
--------------------------------------------------------------------------------

type API = "user"
           :> ReqBody '[JSON] T.Account
           :> Post '[JSON] (Maybe T.Session)
      :<|> "user"
           :> Capture "name" Text
           :> Get  '[JSON] (Maybe T.Account)
      :<|> "trip"
           :> ReqBody '[JSON] T.Trip
           :> Post '[JSON] NoContent
      -- Read
      :<|> "trips"
           :> Get '[JSON] [T.Trip]