vreksam/WebApi/index.html

16 lines
438 B
HTML
Raw Normal View History

2017-06-12 12:46:00 +03:00
<h1>api</h1>
2017-06-12 13:37:48 +03:00
<a href="/api/foorum">foorum</a>
<button onclick="getForums()">GetAll</button>
<code><pre id="output"></pre></code>
<script>
function getForums() {
var out = document.getElementById("output");
fetch("/api/foorum").then(resp => {
return resp.json();
}).then(data => {
console.log(data);
out.innerText = JSON.stringify(data, null, 2);
});
}
</script>