matebeamter/src/API.hs
2019-09-16 09:44:46 +02:00

33 lines
714 B
Haskell

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module API where
import Servant.API
import Servant.Links
import Servant.RawM
import Servant.HTML.Blaze
import Data.Proxy
-- internal imports
import Types
type UserAPI =
Get '[HTML] UserSelectPage
:<|> "user" :> Capture "id" Int :> Get '[HTML] UserOverviewPage
:<|> "auth" :> Get '[HTML] AuthPage
( userSelectLink :<|>
userOverviewLink :<|>
authLink
) = allLinks (Proxy :: Proxy UserAPI)