server: Accept POST instead of GET at babelmark endpoint.
This commit is contained in:
parent
4e003e9cdb
commit
297e48661d
2 changed files with 6 additions and 5 deletions
|
@ -45,7 +45,7 @@ type API =
|
||||||
:<|>
|
:<|>
|
||||||
ReqBody '[JSON] [Params] :> Post '[JSON] [Text]
|
ReqBody '[JSON] [Params] :> Post '[JSON] [Text]
|
||||||
:<|>
|
:<|>
|
||||||
"babelmark" :> ReqBody '[JSON] Params :> Get '[JSON] Value
|
"babelmark" :> ReqBody '[JSON] Params :> Post '[JSON] Value
|
||||||
:<|>
|
:<|>
|
||||||
"version" :> Get '[PlainText, JSON] Text
|
"version" :> Get '[PlainText, JSON] Text
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ function newpage() {
|
||||||
let standalone = params.get("standalone") === "true";
|
let standalone = params.get("standalone") === "true";
|
||||||
document.getElementById("standalone").checked = standalone;
|
document.getElementById("standalone").checked = standalone;
|
||||||
if (text && text != "") {
|
if (text && text != "") {
|
||||||
fetch("/cgi-bin/pandoc-cgi/version")
|
fetch("/cgi-bin/pandoc-server.cgi/version")
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(restext =>
|
.then(restext =>
|
||||||
document.getElementById("version").textContent = restext
|
document.getElementById("version").textContent = restext
|
||||||
|
@ -167,7 +167,7 @@ function newpage() {
|
||||||
|
|
||||||
let params = { from: from, to: to, text: text, standalone: standalone };
|
let params = { from: from, to: to, text: text, standalone: standalone };
|
||||||
// console.log(JSON.stringify(params));
|
// console.log(JSON.stringify(params));
|
||||||
fetch("/cgi-bin/pandoc-cgi", {
|
fetch("/cgi-bin/pandoc-server.cgi", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {"Content-Type": "application/json"},
|
headers: {"Content-Type": "application/json"},
|
||||||
body: JSON.stringify(params)
|
body: JSON.stringify(params)
|
||||||
|
@ -182,8 +182,9 @@ function newpage() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
document.getElementById("convert").onclick = newpage;
|
document.getElementById("convert").onclick = newpage;
|
||||||
document.getElementById("from").onclick = newpage;
|
document.getElementById("from").onchange = newpage;
|
||||||
document.getElementById("to").onclick = newpage;
|
document.getElementById("to").onchange = newpage;
|
||||||
|
document.getElementById("standalone").onchange = newpage;
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue