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


                              


                                                                                



                       
 
                           

                                                                                

                                    
                                            


                                         
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
--------------------------------------------------------------------------------
module API where
--------------------------------------------------------------------------------
import Data.Proxy
import Data.Text
import Database.Persist
import Servant.API

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

type API = "user"
           :> ReqBody '[JSON] T.User
           :> Post '[JSON] (Maybe T.Session)
      :<|> "user"
           :> Capture "name" Text
           :> Get  '[JSON] (Maybe T.User)