traverson
Version:
Hypermedia API/HATEOAS client for Node.js and the browser
72 lines (65 loc) • 2.65 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>Traverson in the Browser</title>
<link rel="stylesheet" type="text/css" href="assets/bootstrap.min.css">
<script src="assets/jquery-2.0.2.min.js"></script>
<script src="../dist/traverson.min.js"></script>
<script src="traverson-examples.js"></script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Traverson in the Browser</h1>
<p>Traverson makes it easy to work with REST/HATEOAS APIs. It works in
Node.js as well as in the browser. This example talks to the local
Traverson test server.</p>
<p>There is also the <a href="github.html">GitHub API Example</a>.</p>
<p><a id="btn-all"
class="btn btn-primary btn-lg"
role="button">Start All Requests At Once</a></p>
</div>
<small>
<p>
You need to start the test server contained in the Traverson repository
with <tt>node bin/start-test-server.js</tt>. This serves this page as
well as the REST API that is used in the examples. Open the URL
<a href="http://localhost:2808/static/browser/example"
>http://localhost:2808/static/browser/example</a>
in your browser. If the URL in your browser's address bar says
<tt>file:...</tt> the examples on this page will <em>not</em> work.
</p>
</small>
<h2>Setup</h2>
<div id="general"><img src="assets/spinner.gif"/></div>
<hr>
<h2>Plain Vanilla Link Following</h2>
<div class="row">
<div id="plain_vanilla_request" class="col-md-4"><img src="assets/spinner.gif"/></div>
<div class="col-md-2">
<a id="btn-plain-vanilla" class="btn btn-primary" role="button">Start Request</a>
</div>
<pre id="plain_vanilla_response" class="col-md-6"></pre>
</div>
<hr>
<h2>JSONPath</h3>
<div class="row">
<div id="jsonpath_request" class="col-md-4"><img src="assets/spinner.gif"/></div>
<div class="col-md-2">
<a id="btn-jsonpath" class="btn btn-primary" role="button">Start Request</a>
</div>
<pre id="jsonpath_response" class="col-md-6"></pre>
</div>
<hr>
<h2>URI Templates</h2>
<div class="row">
<div id="uri_template_request" class="col-md-4"><img src="assets/spinner.gif"/></div>
<div class="col-md-2">
<a id="btn-uri-template" class="btn btn-primary" role="button">Start Request</a>
</div>
<pre id="uri_template_response" class="col-md-6"></pre>
</div>
<hr>
</div>
</body>
</html>