Add version endpoint to pandoc-cgi
This commit is contained in:
parent
48b4e46603
commit
83d81b34b6
1 changed files with 3 additions and 0 deletions
|
@ -44,6 +44,8 @@ type API =
|
|||
"convert" :> ReqBody '[JSON] Params :> Post '[PlainText, JSON] Text
|
||||
:<|>
|
||||
"convert-batch" :> ReqBody '[JSON] [Params] :> Post '[JSON] [Text]
|
||||
:<|>
|
||||
"version" :> Get '[PlainText, JSON] Text
|
||||
|
||||
app :: Application
|
||||
app = serve api server
|
||||
|
@ -54,6 +56,7 @@ api = Proxy
|
|||
server :: Server API
|
||||
server = convert
|
||||
:<|> mapM convert
|
||||
:<|> pure pandocVersion
|
||||
where
|
||||
-- We use runPure for the pandoc conversions, which ensures that
|
||||
-- they will do no IO. This makes the server safe to use. However,
|
||||
|
|
Loading…
Reference in a new issue