From 83d81b34b60437f17e32b5e46403b8eb89534d12 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 7 Aug 2022 09:48:56 -0700 Subject: [PATCH] Add version endpoint to pandoc-cgi --- pandoc-cgi/PandocCGI.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandoc-cgi/PandocCGI.hs b/pandoc-cgi/PandocCGI.hs index 73825311b..11a3af0bb 100644 --- a/pandoc-cgi/PandocCGI.hs +++ b/pandoc-cgi/PandocCGI.hs @@ -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,