diff --git a/index.html b/index.html
index 48dc4187..496ec69f 100644
--- a/index.html
+++ b/index.html
@@ -380,22 +380,24 @@
input.type = 'text';
input.value = v;
input.style.width = '100%';
- input.onkeydown = function(e) {
- if (e.key === 'Enter') {
- const postUrl = '/kvs?mount=' + encodeURIComponent(mount);
- fetch(postUrl, {
- method: 'POST',
- headers: {'Content-Type': 'application/json'},
- body: JSON.stringify({[k]: input.value})
- }).then(response => {
- if (!response.ok) {
- response.text().then(body => {
- alert('Status: ' + response.status + '\nBody: ' + body);
- });
- }
- });
- }
- };
+ input.onkeydown = function(e) {
+ if (e.key === 'Enter') {
+ const key = encodeURIComponent(k)
+ const mount_uri = encodeURIComponent(mount)
+ const postUrl = `/kvs/${key}?mount=${mount}`
+ fetch(postUrl, {
+ method: 'POST',
+ headers: {'Content-Type': 'application/json'},
+ body: JSON.stringify(input.value)
+ }).then(response => {
+ if (!response.ok) {
+ response.text().then(body => {
+ alert('Status: ' + response.status + '\nBody: ' + body);
+ });
+ }
+ });
+ }
+ };
valueCell.appendChild(input);
row.appendChild(keyCell);
row.appendChild(valueCell);
@@ -595,10 +597,10 @@
}
});
const branchesStr = branches.join(':');
- fetch('/kvs?mount=' + encodeURIComponent(mount), {
+ fetch(`/kvs/branches?mount=${encodeURIComponent(mount)}`, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
- body: JSON.stringify({"branches": branchesStr})
+ body: JSON.stringify(branchesStr)
}).then(response => {
if (!response.ok) {
response.text().then(body => {