aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-07-03 11:42:33 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-07-03 11:42:33 +0200
commit61305fa6d9faa8bd547faeb6bc3d938251ea9e6c (patch)
tree02ed301cb93a23d0013d7fff5fb3aebf6208c05e
parent9c3f73417d644439bb78b0eb672a35d243eef9a1 (diff)
downloadexample-collection-json-db-61305fa6d9faa8bd547faeb6bc3d938251ea9e6c.tar.gz
example-collection-json-db-61305fa6d9faa8bd547faeb6bc3d938251ea9e6c.tar.bz2
example-collection-json-db-61305fa6d9faa8bd547faeb6bc3d938251ea9e6c.tar.xz
example-collection-json-db-61305fa6d9faa8bd547faeb6bc3d938251ea9e6c.zip
o Adding some 'about' into on the front page.
-rw-r--r--README.md2
-rw-r--r--views/index.jade88
2 files changed, 88 insertions, 2 deletions
diff --git a/README.md b/README.md
index 6532693..9fd6e16 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
This application will give you a set of Collection+JSON resources
useful for creating
-[Collection+JSON](http://trygvis.dyndns.org/~trygvis/git/2012/06/collection+json-explorer.git)-related
+[Collection+JSON](http://amundsen.com/media-types/collection/)-related
tools. It is developed in combination with the [Collection+JSON
Explorer](http://trygvis.dyndns.org/~trygvis/git/2012/06/collection+json-explorer.git).
diff --git a/views/index.jade b/views/index.jade
index f195915..7ff1bb1 100644
--- a/views/index.jade
+++ b/views/index.jade
@@ -1,7 +1,93 @@
extends layout
block content
- p Available resources
+ 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
+ | .
+
+ 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..