From 4353d3d7ceb01ebe21a99c0064b2d0da1ee53bae Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 12 Sep 2014 19:16:27 +0100 Subject: [PATCH] add docs --- docs/404.md | 19 ++++++++----------- docs/cors.md | 9 +++------ docs/index.md | 27 ++++++++++++--------------- docs/jsonp.md | 9 +++------ docs/suggest/success.md | 23 ++++++++++------------- 5 files changed, 36 insertions(+), 51 deletions(-) diff --git a/docs/404.md b/docs/404.md index 4694f1a2..3760d337 100644 --- a/docs/404.md +++ b/docs/404.md @@ -1,6 +1,6 @@ # invalid path -*Generated: Fri Sep 12 2014 19:14:09 GMT+0100 (BST)* +*Generated: Fri Sep 12 2014 19:16:14 GMT+0100 (BST)* ## Request ```javascript { @@ -8,10 +8,7 @@ "host": "localhost", "method": "GET", "port": 3100, - "path": "/notexist", - "headers": { - "User-Agent": "Ciao/Client 1.0" - } + "path": "/notexist" } ``` @@ -29,7 +26,7 @@ Status: 404 "content-type": "application/json; charset=utf-8", "content-length": "35", "etag": "W/\"23-dfdfa185\"", - "date": "Fri, 12 Sep 2014 18:14:09 GMT", + "date": "Fri, 12 Sep 2014 18:16:14 GMT", "connection": "close" } ``` @@ -41,11 +38,6 @@ Status: 404 ## Tests -### ✓ content-type header correctly set -```javascript -response.should.have.header 'Content-Type','application/json; charset=utf-8' -``` - ### ✓ should respond in json with server info ```javascript should.exist json @@ -53,6 +45,11 @@ should.exist json.error json.error.should.equal 'not found: invalid path' ``` +### ✓ content-type header correctly set +```javascript +response.should.have.header 'Content-Type','application/json; charset=utf-8' +``` + ### ✓ cache-control header correctly set ```javascript response.should.have.header 'Cache-Control','public,max-age=300' diff --git a/docs/cors.md b/docs/cors.md index 77d10ea7..14f1a4ae 100644 --- a/docs/cors.md +++ b/docs/cors.md @@ -1,6 +1,6 @@ # cross-origin resource sharing -*Generated: Fri Sep 12 2014 19:14:09 GMT+0100 (BST)* +*Generated: Fri Sep 12 2014 19:16:14 GMT+0100 (BST)* ## Request ```javascript { @@ -8,10 +8,7 @@ "host": "localhost", "method": "GET", "port": 3100, - "path": "/", - "headers": { - "User-Agent": "Ciao/Client 1.0" - } + "path": "/" } ``` @@ -29,7 +26,7 @@ Status: 200 "content-type": "application/json; charset=utf-8", "content-length": "50", "etag": "W/\"32-85536434\"", - "date": "Fri, 12 Sep 2014 18:14:09 GMT", + "date": "Fri, 12 Sep 2014 18:16:14 GMT", "connection": "close" } ``` diff --git a/docs/index.md b/docs/index.md index 917f36f8..3ea5e22b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # api root -*Generated: Fri Sep 12 2014 19:14:09 GMT+0100 (BST)* +*Generated: Fri Sep 12 2014 19:16:14 GMT+0100 (BST)* ## Request ```javascript { @@ -8,10 +8,7 @@ "host": "localhost", "method": "GET", "port": 3100, - "path": "/", - "headers": { - "User-Agent": "Ciao/Client 1.0" - } + "path": "/" } ``` @@ -29,7 +26,7 @@ Status: 200 "content-type": "application/json; charset=utf-8", "content-length": "50", "etag": "W/\"32-85536434\"", - "date": "Fri, 12 Sep 2014 18:14:09 GMT", + "date": "Fri, 12 Sep 2014 18:16:14 GMT", "connection": "close" } ``` @@ -44,11 +41,6 @@ Status: 200 ## Tests -### ✓ endpoint available -```javascript -response.statusCode.should.equal 200 -``` - ### ✓ vanity header correctly set ```javascript response.should.have.header 'X-Powered-By','pelias' @@ -59,11 +51,9 @@ response.should.have.header 'X-Powered-By','pelias' response.should.have.header 'Cache-Control','public,max-age=60' ``` -### ✓ should respond in json with server info +### ✓ endpoint available ```javascript -should.exist json -should.exist json.name -should.exist json.version +response.statusCode.should.equal 200 ``` ### ✓ content-type header correctly set @@ -76,3 +66,10 @@ response.should.have.header 'Content-Type','application/json; charset=utf-8' response.should.have.header 'Charset','utf8' ``` +### ✓ should respond in json with server info +```javascript +should.exist json +should.exist json.name +should.exist json.version +``` + diff --git a/docs/jsonp.md b/docs/jsonp.md index 861785cb..a6fe0ead 100644 --- a/docs/jsonp.md +++ b/docs/jsonp.md @@ -1,6 +1,6 @@ # jsonp -*Generated: Fri Sep 12 2014 19:14:09 GMT+0100 (BST)* +*Generated: Fri Sep 12 2014 19:16:14 GMT+0100 (BST)* ## Request ```javascript { @@ -8,10 +8,7 @@ "host": "localhost", "method": "GET", "port": 3100, - "path": "/?callback=test", - "headers": { - "User-Agent": "Ciao/Client 1.0" - } + "path": "/?callback=test" } ``` @@ -29,7 +26,7 @@ Status: 200 "content-type": "application/javascript; charset=utf-8", "content-length": "57", "etag": "W/\"39-b8a2aba1\"", - "date": "Fri, 12 Sep 2014 18:14:09 GMT", + "date": "Fri, 12 Sep 2014 18:16:14 GMT", "connection": "close" } ``` diff --git a/docs/suggest/success.md b/docs/suggest/success.md index 0019f600..762e52e4 100644 --- a/docs/suggest/success.md +++ b/docs/suggest/success.md @@ -1,6 +1,6 @@ # valid suggest query -*Generated: Fri Sep 12 2014 19:14:09 GMT+0100 (BST)* +*Generated: Fri Sep 12 2014 19:16:14 GMT+0100 (BST)* ## Request ```javascript { @@ -8,10 +8,7 @@ "host": "localhost", "method": "GET", "port": 3100, - "path": "/suggest?input=a&lat=0&lon=0", - "headers": { - "User-Agent": "Ciao/Client 1.0" - } + "path": "/suggest?input=a&lat=0&lon=0" } ``` @@ -28,14 +25,14 @@ Status: 200 "cache-control": "public,max-age=60", "content-type": "application/json; charset=utf-8", "content-length": "1248", - "etag": "W/\"jtfnMCXDw5frK6L5eD1thg==\"", - "date": "Fri, 12 Sep 2014 18:14:09 GMT", + "etag": "W/\"htT1UWW77Ibdm7ncnD9KgA==\"", + "date": "Fri, 12 Sep 2014 18:16:14 GMT", "connection": "close" } ``` ```javascript { - "date": 1410545649156, + "date": 1410545774257, "body": [ { "text": "ACRELÂNDIA, Brazil", @@ -123,11 +120,6 @@ Status: 200 ## Tests -### ✓ 200 ok -```javascript -response.statusCode.should.equal 200 -``` - ### ✓ valid response ```javascript now = new Date().getTime() @@ -139,3 +131,8 @@ should.exist json.body json.body.should.be.instanceof Array ``` +### ✓ 200 ok +```javascript +response.statusCode.should.equal 200 +``` +