2019-09-08 00:37:50 +00:00
|
|
|
{-# LANGUAGE DataKinds #-}
|
|
|
|
{-# LANGUAGE TypeOperators #-}
|
|
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
|
|
{-# LANGUAGE FlexibleInstances #-}
|
|
|
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
{-# LANGUAGE RankNTypes #-}
|
|
|
|
{-# LANGUAGE ScopedTypeVariables #-}
|
|
|
|
|
|
|
|
module API where
|
|
|
|
|
|
|
|
import Servant.API
|
2019-09-16 07:44:46 +00:00
|
|
|
import Servant.Links
|
2019-09-08 00:37:50 +00:00
|
|
|
import Servant.RawM
|
|
|
|
import Servant.HTML.Blaze
|
|
|
|
|
2019-09-16 07:44:46 +00:00
|
|
|
import Data.Proxy
|
|
|
|
|
2019-09-08 00:37:50 +00:00
|
|
|
-- internal imports
|
|
|
|
|
|
|
|
import Types
|
|
|
|
|
|
|
|
type UserAPI =
|
2019-09-11 04:27:54 +00:00
|
|
|
Get '[HTML] UserSelectPage
|
|
|
|
:<|> "user" :> Capture "id" Int :> Get '[HTML] UserOverviewPage
|
|
|
|
:<|> "auth" :> Get '[HTML] AuthPage
|
2019-09-08 10:48:57 +00:00
|
|
|
|
2019-09-16 07:44:46 +00:00
|
|
|
|
|
|
|
( userSelectLink :<|>
|
|
|
|
userOverviewLink :<|>
|
|
|
|
authLink
|
|
|
|
) = allLinks (Proxy :: Proxy UserAPI)
|