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" :> ReqBody '[JSON] Params :> Post '[PlainText, JSON] Text
|
||||||
:<|>
|
:<|>
|
||||||
"convert-batch" :> ReqBody '[JSON] [Params] :> Post '[JSON] [Text]
|
"convert-batch" :> ReqBody '[JSON] [Params] :> Post '[JSON] [Text]
|
||||||
|
:<|>
|
||||||
|
"version" :> Get '[PlainText, JSON] Text
|
||||||
|
|
||||||
app :: Application
|
app :: Application
|
||||||
app = serve api server
|
app = serve api server
|
||||||
|
@ -54,6 +56,7 @@ api = Proxy
|
||||||
server :: Server API
|
server :: Server API
|
||||||
server = convert
|
server = convert
|
||||||
:<|> mapM convert
|
:<|> mapM convert
|
||||||
|
:<|> pure pandocVersion
|
||||||
where
|
where
|
||||||
-- We use runPure for the pandoc conversions, which ensures that
|
-- We use runPure for the pandoc conversions, which ensures that
|
||||||
-- they will do no IO. This makes the server safe to use. However,
|
-- they will do no IO. This makes the server safe to use. However,
|
||||||
|
|
Loading…
Add table
Reference in a new issue