forked from schmittlauch/Hash2Pub
parent
e2ecf0739d
commit
5fedd9f87c
2 changed files with 19 additions and 2 deletions
17
src/Hash2Pub/PostService.hs
Normal file
17
src/Hash2Pub/PostService.hs
Normal file
|
@ -0,0 +1,17 @@
|
|||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Hash2Pub.PostService where
|
||||
|
||||
import Servant
|
||||
import qualified Data.Text as Txt
|
||||
|
||||
type ServiceAPI = "relay" :> "inbox" :> PostCreated '[PlainText] Txt.Text
|
||||
-- ^ delivery endpoint of new posts to relay
|
||||
:<|> "relay" :> "subscribers" :> Post '[PlainText] Txt.Text
|
||||
-- ^ endpoint for delivering the subscription and outstanding queue
|
||||
:<|> "post" :> Capture "postid" Txt.Text :> Get '[PlainText] Txt.Text
|
||||
:<|> "tags" :> Capture "hashtag" Txt.Text :> PostCreated '[PlainText] Txt.Text
|
||||
:<|> "tags" :> Capture "hashtag" Txt.Text :> "subscribe" :> Header "Origin" Txt.Text :> Get '[PlainText] Txt.Text
|
||||
:<|> "tags" :> Capture "hashtag" Txt.Text :> "unsubscribe" :> Header "Origin" Txt.Text :> Get '[PlainText] Txt.Text
|
Loading…
Add table
Add a link
Reference in a new issue