Skip to content

Commit f21d3ed

Browse files
committed
Add docs for remove index
1 parent 8f72e27 commit f21d3ed

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

docs/pkgs.html

+36-21
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,45 @@ <h2>Add Indexes</h2>
3434
</textarea><br>
3535
<button onclick="tryCode('indexesCreate', 'indexesCreateRes');">Try</button>
3636

37+
<p>You can now check if the new package_index was downloaded by repeating List Indexes.</p>
38+
39+
<h2>Remove Indexes</h2>
40+
<p>You can add a new index with a POST request</p>
41+
<textarea cols="100" rows="5" id="indexesRemove">
42+
fetch('http://localhost:8991/v2/pkgs/indexes/delete', {
43+
method: "POST",
44+
body: '{"url": "https://downloads.arduino.cc/packages/package_index.json"}'
45+
})
46+
</textarea><br>
47+
<textarea cols="100" rows="10" id="indexesRemoveRes">
48+
49+
</textarea><br>
50+
<button onclick="tryCode('indexesRemove', 'indexesRemoveRes');">Try</button>
51+
52+
<p>You can now check if the new package_index was removed by repeating List Indexes.</p>
53+
54+
3755
</body>
3856

3957
<script>
40-
function tryCode(code, target) {
41-
code = document.getElementById(code).textContent;
42-
target = document.getElementById(target);
43-
44-
var result = eval(code);
45-
result.then(function (res) {
46-
target.innerHTML = res.statusText + "\n";
47-
return res.json();
48-
}).then(function (body) {
49-
target.innerHTML = target.innerHTML + JSON.stringify(body, " ", " ");
50-
return;
51-
})
52-
.catch(function (err) {
53-
54-
console.log(err)
55-
56-
target.innerText = err;
57-
})
58-
59-
console.debug(code, target, result)
60-
}
58+
function tryCode(code, target) {
59+
code = document.getElementById(code).textContent;
60+
target = document.getElementById(target);
61+
62+
var result = eval(code);
63+
result.then(function (res) {
64+
target.innerHTML = res.statusText + "\n"; return res.text();
65+
}).then(function (body) {
66+
target.innerHTML = target.innerHTML + body;
67+
}).catch(function (err) {
68+
69+
console.log(err)
70+
71+
target.innerText = err;
72+
})
73+
74+
console.debug(code, target, result)
75+
}
6176
</script>
6277

6378
</html>

0 commit comments

Comments
 (0)