-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathoctocat.js
More file actions
51 lines (41 loc) · 920 Bytes
/
octocat.js
File metadata and controls
51 lines (41 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
# Zen of GitHub
## Setup
```javascript
const GitHubClient = require('../libs/GitHubClient.js').GitHubClient;
const octocat = require('../libs/features/octocat');
let githubCli = new GitHubClient({
baseUri: "http://github.at.home/api/v3",
token: process.env.TOKEN_GHITHUB_ENTERPRISE
}, octocat); //<-- add octocat feature
```
*/
const fetch = require('node-fetch');
/*
## octocat
- return: `Promise`
### Description
`octocat` gets octocat mindset
*/
function octocat() {
let _response = {};
return fetch(this.baseUri + `/octocat`, {
method: 'GET',
headers: this.headers
})
.then(response => {
if (response.ok) {
return response.text()
} else {
throw new HttpException({
message: "HttpException",
status:response.status,
statusText:response.statusText,
url: response.url
});
}
})
}
module.exports = {
octocat: octocat
};