Add version endpoint to pandoc-cgi

This commit is contained in:
John MacFarlane 2022-08-07 09:48:56 -07:00
parent 48b4e46603
commit 83d81b34b6

View file

@ -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,