{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PackageImports #-} module API where import Servant.API import Servant.Links import Servant.RawM import Servant.HTML.Blaze import Data.Proxy -- imports from "mateamt" import qualified "mateamt" Types as MT -- internal imports import Types type UserAPI = Get '[HTML] UserSelectPage :<|> "user" :> Capture "id" Int :> Get '[HTML] UserOverviewPage :<|> "user" :> "create" :> Get '[HTML] UserNewPage :<|> "user" :> "create" :> ReqBody '[FormUrlEncoded] MT.UserSubmit :> Post '[HTML] UserSelectPage :<|> "auth" :> Get '[HTML] AuthPage ( userSelectLink :<|> userOverviewLink :<|> userNewLink :<|> userNewPostLink :<|> authLink ) = allLinks (Proxy :: Proxy UserAPI)