api: first app! lists account names
This commit is contained in:
parent
93826fdc85
commit
bd023134f2
29
hledger-api/examples/01-accounts.html
Normal file
29
hledger-api/examples/01-accounts.html
Normal 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>
|
||||
@ -1,6 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<p>
|
||||
Hello world. Just a static file, nothing going on here.
|
||||
</body>
|
||||
</html>
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user