Skip to content

Commit

Permalink
Merge pull request #511 from Jameskmonger/patch-1
Browse files Browse the repository at this point in the history
Add JavaScript examples
  • Loading branch information
lord committed May 24, 2016
2 parents 1e54d1d + cec5d66 commit ed6578c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ language_tabs:
- shell
- ruby
- python
- javascript

toc_footers:
- <a href='#'>Sign Up for a Developer Key</a>
Expand Down Expand Up @@ -46,6 +47,12 @@ curl "api_endpoint_here"
-H "Authorization: meowmeowmeow"
```

```javascript
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
```

> Make sure to replace `meowmeowmeow` with your API key.
Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers).
Expand Down Expand Up @@ -81,6 +88,13 @@ curl "http://example.com/api/kittens"
-H "Authorization: meowmeowmeow"
```

```javascript
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let kittens = api.kittens.get();
```

> The above command returns JSON structured like this:
```json
Expand Down Expand Up @@ -140,6 +154,13 @@ curl "http://example.com/api/kittens/2"
-H "Authorization: meowmeowmeow"
```

```javascript
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.get(2);
```

> The above command returns JSON structured like this:
```json
Expand Down

0 comments on commit ed6578c

Please sign in to comment.