Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node-slate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Hải Sơn
node-slate
Commits
ed6578ca
Commit
ed6578ca
authored
May 24, 2016
by
Robert Lord
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #511 from Jameskmonger/patch-1
Add JavaScript examples
parents
1e54d1dd
cec5d662
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
index.html.md
source/index.html.md
+21
-0
No files found.
source/index.html.md
View file @
ed6578ca
...
@@ -5,6 +5,7 @@ language_tabs:
...
@@ -5,6 +5,7 @@ language_tabs:
-
shell
-
shell
-
ruby
-
ruby
-
python
-
python
-
javascript
toc_footers
:
toc_footers
:
-
<a href='#'>Sign Up for a Developer Key</a>
-
<a href='#'>Sign Up for a Developer Key</a>
...
@@ -46,6 +47,12 @@ curl "api_endpoint_here"
...
@@ -46,6 +47,12 @@ curl "api_endpoint_here"
-H
"Authorization: meowmeowmeow"
-H
"Authorization: meowmeowmeow"
```
```
```
javascript
const
kittn
=
require
(
'kittn'
);
let
api
=
kittn
.
authorize
(
'meowmeowmeow'
);
```
> Make sure to replace `meowmeowmeow` with your API key.
> 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
)
.
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
)
.
...
@@ -81,6 +88,13 @@ curl "http://example.com/api/kittens"
...
@@ -81,6 +88,13 @@ curl "http://example.com/api/kittens"
-H
"Authorization: meowmeowmeow"
-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:
> The above command returns JSON structured like this:
```
json
```
json
...
@@ -140,6 +154,13 @@ curl "http://example.com/api/kittens/2"
...
@@ -140,6 +154,13 @@ curl "http://example.com/api/kittens/2"
-H
"Authorization: meowmeowmeow"
-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:
> The above command returns JSON structured like this:
```
json
```
json
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment