extends layout block content h2 Available resources ul li: a(href=urlgenerator.departments()) Departments list li: a(href=urlgenerator.employees()) Employees list h2 About p This application will give you a set of Collection+JSON resources | useful for creating a(href='http://amundsen.com/media-types/collection/') Collection+JSON | -related tools. It is developed in combination with the a(href='http://trygvis.dyndns.org/~trygvis/git/2012/06/collection+json-explorer.git') Collection+JSON Explorer | . h3 Explore p To explore the data, queries and templates available you can either use the a(href='http://collection-json-explorer.herokuapp.com') online explorer | , command line tools like curl or wget or any other HTTP client. p Note that unless you explicitly request code text/html | you will be served code application/vnd.collection+json | if you include code */* | in your code Accept | header. If you request only unsupported types, you'll get a a(href='http://httpstatus.es/406') 406 | . h4 Exploring with curl p These examples use a Python tool to format the json as the server serves | compacted JSON. If you want to see the headers served, add code -D /dev/stderr | and you'll get the headers too. p Start by fetching the root document: pre. $ curl -s http://employee.herokuapp.com/ | python -mjson.tool { "collection": { "items": [], "links": [ { "href": "http://employee.herokuapp.com/department/", "prompt": "Department List", "rel": "departments" }, { "href": "http://employee.herokuapp.com/employee/", "prompt": "Employee List", "rel": "employees" } ], "queries": [], "templates": [], "version": "1.0" } } p This will show all available root resources. Navigate to the department list: pre. $ curl -s http://employee.herokuapp.com/department/ | python -mjson.tool { "collection": { "href": "http://employee.herokuapp.com/department/", "items": [ { "data": [ { "name": "dept_no", "value": "d001" }, { "name": "dept_name", "value": "Marketing" } ], "href": "http://employee.herokuapp.com/department/d001", "links": [] }, ... ], "links": [], "queries": [], "templates": [], "version": "1.0" } } p etc..