Browse Source

docs

pull/7/head
Peter Johnson 10 years ago
parent
commit
59a589b2d4
  1. 26
      docs/404.md
  2. 8
      docs/cors.md
  3. 28
      docs/index.md
  4. 8
      docs/jsonp.md
  5. 22
      docs/suggest/success.md

26
docs/404.md

@ -1,6 +1,6 @@
# invalid path
*Generated: Fri Sep 12 2014 20:51:44 GMT+0100 (BST)*
*Generated: Thu Sep 18 2014 14:53:39 GMT+0100 (BST)*
## Request
```javascript
{
@ -18,16 +18,16 @@ Status: 404
{
"x-powered-by": "mapzen",
"charset": "utf8",
"cache-control": "public,max-age=300",
"server": "Pelias/0.0.0",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET",
"access-control-allow-headers": "X-Requested-With,content-type",
"access-control-allow-credentials": "true",
"server": "Pelias/0.0.0",
"cache-control": "public,max-age=300",
"content-type": "application/json; charset=utf-8",
"content-length": "35",
"etag": "W/\"23-dfdfa185\"",
"date": "Fri, 12 Sep 2014 19:51:44 GMT",
"date": "Thu, 18 Sep 2014 13:53:39 GMT",
"connection": "close"
}
```
@ -39,19 +39,14 @@ Status: 404
## Tests
### ✓ cache-control header correctly set
```javascript
response.should.have.header 'Cache-Control','public,max-age=300'
```
### ✓ content-type header correctly set
### ✓ not found
```javascript
response.should.have.header 'Content-Type','application/json; charset=utf-8'
response.statusCode.should.equal 404
```
### ✓ not found
### ✓ cache-control header correctly set
```javascript
response.statusCode.should.equal 404
response.should.have.header 'Cache-Control','public,max-age=300'
```
### ✓ should respond in json with server info
@ -61,3 +56,8 @@ 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'
```

8
docs/cors.md

@ -1,6 +1,6 @@
# cross-origin resource sharing
*Generated: Fri Sep 12 2014 20:51:44 GMT+0100 (BST)*
*Generated: Thu Sep 18 2014 14:53:39 GMT+0100 (BST)*
## Request
```javascript
{
@ -18,16 +18,16 @@ Status: 200
{
"x-powered-by": "mapzen",
"charset": "utf8",
"cache-control": "public,max-age=60",
"server": "Pelias/0.0.0",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET",
"access-control-allow-headers": "X-Requested-With,content-type",
"access-control-allow-credentials": "true",
"server": "Pelias/0.0.0",
"cache-control": "public,max-age=60",
"content-type": "application/json; charset=utf-8",
"content-length": "50",
"etag": "W/\"32-85536434\"",
"date": "Fri, 12 Sep 2014 19:51:44 GMT",
"date": "Thu, 18 Sep 2014 13:53:39 GMT",
"connection": "close"
}
```

28
docs/index.md

@ -1,6 +1,6 @@
# api root
*Generated: Fri Sep 12 2014 20:51:45 GMT+0100 (BST)*
*Generated: Thu Sep 18 2014 14:53:39 GMT+0100 (BST)*
## Request
```javascript
{
@ -18,16 +18,16 @@ Status: 200
{
"x-powered-by": "mapzen",
"charset": "utf8",
"cache-control": "public,max-age=60",
"server": "Pelias/0.0.0",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET",
"access-control-allow-headers": "X-Requested-With,content-type",
"access-control-allow-credentials": "true",
"server": "Pelias/0.0.0",
"cache-control": "public,max-age=60",
"content-type": "application/json; charset=utf-8",
"content-length": "50",
"etag": "W/\"32-85536434\"",
"date": "Fri, 12 Sep 2014 19:51:44 GMT",
"date": "Thu, 18 Sep 2014 13:53:39 GMT",
"connection": "close"
}
```
@ -42,6 +42,12 @@ Status: 200
## Tests
### ✓ server header correctly set
```javascript
response.should.have.header 'Server'
response.headers.server.should.match /Pelias\/\d{1,2}\.\d{1,2}\.\d{1,2}/
```
### ✓ content-type header correctly set
```javascript
response.should.have.header 'Content-Type','application/json; charset=utf-8'
@ -57,20 +63,14 @@ response.statusCode.should.equal 200
response.should.have.header 'Cache-Control','public,max-age=60'
```
### ✓ charset header correctly set
```javascript
response.should.have.header 'Charset','utf8'
```
### ✓ server header correctly set
### ✓ vanity header correctly set
```javascript
response.should.have.header 'Server'
response.headers.server.should.match /Pelias\/\d{1,2}\.\d{1,2}\.\d{1,2}/
response.should.have.header 'X-Powered-By','mapzen'
```
### ✓ vanity header correctly set
### ✓ charset header correctly set
```javascript
response.should.have.header 'X-Powered-By','mapzen'
response.should.have.header 'Charset','utf8'
```
### ✓ should respond in json with server info

8
docs/jsonp.md

@ -1,6 +1,6 @@
# jsonp
*Generated: Fri Sep 12 2014 20:51:45 GMT+0100 (BST)*
*Generated: Thu Sep 18 2014 14:53:39 GMT+0100 (BST)*
## Request
```javascript
{
@ -18,16 +18,16 @@ Status: 200
{
"x-powered-by": "mapzen",
"charset": "utf8",
"cache-control": "public,max-age=60",
"server": "Pelias/0.0.0",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET",
"access-control-allow-headers": "X-Requested-With,content-type",
"access-control-allow-credentials": "true",
"server": "Pelias/0.0.0",
"cache-control": "public,max-age=60",
"content-type": "application/javascript; charset=utf-8",
"content-length": "57",
"etag": "W/\"39-b8a2aba1\"",
"date": "Fri, 12 Sep 2014 19:51:44 GMT",
"date": "Thu, 18 Sep 2014 13:53:39 GMT",
"connection": "close"
}
```

22
docs/suggest/success.md

@ -1,6 +1,6 @@
# valid suggest query
*Generated: Fri Sep 12 2014 20:51:45 GMT+0100 (BST)*
*Generated: Thu Sep 18 2014 14:53:39 GMT+0100 (BST)*
## Request
```javascript
{
@ -18,22 +18,22 @@ Status: 200
{
"x-powered-by": "mapzen",
"charset": "utf8",
"cache-control": "public,max-age=60",
"server": "Pelias/0.0.0",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET",
"access-control-allow-headers": "X-Requested-With,content-type",
"access-control-allow-credentials": "true",
"server": "Pelias/0.0.0",
"cache-control": "public,max-age=60",
"content-type": "application/json; charset=utf-8",
"content-length": "1248",
"etag": "W/\"o9NALcf9i0O3JoLO7pfqog==\"",
"date": "Fri, 12 Sep 2014 19:51:44 GMT",
"etag": "W/\"H7TGcVqWuu8sAb6aBhpd6A==\"",
"date": "Thu, 18 Sep 2014 13:53:39 GMT",
"connection": "close"
}
```
```javascript
{
"date": 1410551504928,
"date": 1411048419796,
"body": [
{
"text": "ACRELÂNDIA, Brazil",
@ -121,6 +121,11 @@ Status: 200
## Tests
### ✓ 200 ok
```javascript
response.statusCode.should.equal 200
```
### ✓ valid response
```javascript
now = new Date().getTime()
@ -132,8 +137,3 @@ should.exist json.body
json.body.should.be.instanceof Array
```
### ✓ 200 ok
```javascript
response.statusCode.should.equal 200
```

Loading…
Cancel
Save