summaryrefslogtreecommitdiff
path: root/pandoc-server/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-11-08 12:45:15 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2022-11-08 12:45:15 -0800
commite2899fd52af6bcd962e4905f13deb5818ad42ded (patch)
tree2f7cee6138a69ac1af02f03511af578dbff61dd2 /pandoc-server/src/Text
parentdee186be7d90583dbe25f318d99c30b3a61345dd (diff)
Add simple CORS support to pandoc-server.
Closes #8427.
Diffstat (limited to 'pandoc-server/src/Text')
-rw-r--r--pandoc-server/src/Text/Pandoc/Server.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/pandoc-server/src/Text/Pandoc/Server.hs b/pandoc-server/src/Text/Pandoc/Server.hs
index c45dfa381..e3965b45b 100644
--- a/pandoc-server/src/Text/Pandoc/Server.hs
+++ b/pandoc-server/src/Text/Pandoc/Server.hs
@@ -47,6 +47,7 @@ import Text.Pandoc.Format (parseFlavoredFormat, formatName)
import Text.Pandoc.SelfContained (makeSelfContained)
import System.Exit
import GHC.Generics (Generic)
+import Network.Wai.Middleware.Cors (simpleCors)
data ServerOpts =
ServerOpts
@@ -197,7 +198,7 @@ type API =
"version" :> Get '[PlainText, JSON] Text
app :: Application
-app = serve api server
+app = simpleCors $ serve api server
api :: Proxy API
api = Proxy