api: first app! lists account names

This commit is contained in:
Simon Michael 2016-01-09 15:54:22 -08:00
parent 93826fdc85
commit bd023134f2
3 changed files with 30 additions and 7 deletions

View File

@ -0,0 +1,29 @@
<html>
<head>
<meta charset="utf-8">
<title>hledger-api example 01</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head
<body>
<p>
Account names:
<pre></pre>
<script>
$(document).ready(
function() {
$.ajax({
url: "http://localhost:8001/accounts",
context: document.body,
success: function(data){
$('pre').text(data.join('\n'));
}
});
}
);
</script>
</body>
</html>

View File

@ -1,6 +0,0 @@
<html>
<body>
<p>
Hello world. Just a static file, nothing going on here.
</body>
</html>

View File

@ -27,7 +27,7 @@ cabal-version: >= 1.10
extra-source-files:
CHANGES
examples/01-hello.html
examples/01-accounts.html
source-repository head
type: git