Putting It All Together

Let’s look at an example of a service that has a couple of resources that allow the client to read and store some data.

The application will display a list of users and allow the client to add additional users to the list. The client will be implemented in JavaScript and use Ajax to communicate with the service.

To start, let’s create a static HTML page in our public directory and call it home.html. The page contents will look like this:

liberator-snippets/home.html
 
<html>
 
<head>
 
<title>​Liberator Example​</title>
 
<script​ type=​"text/javascript"
 
src=​"//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"​​>
 
</script>
 
 
<script​ type=​"text/javascript"​​>
 
function renderUsers(users) ...

Get Web Development with Clojure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.