|
|
@@ -23,8 +23,6 @@ module.exports = function(Team, Token) {
|
|
|
options.path = `/api/v2/${path}`;
|
|
|
const req = https.request(options, (res) => {
|
|
|
res.on('data', (chunk) => {
|
|
|
- // console.log(`${chunk}`);
|
|
|
- console.log(`${chunk}`);
|
|
|
resolve(chunk);
|
|
|
});
|
|
|
});
|
|
|
@@ -48,15 +46,18 @@ module.exports = function(Team, Token) {
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
- // tags: restAPI('tags'),
|
|
|
- // templates: restAPI('templates'),
|
|
|
- // projects: restAPI('projects'),
|
|
|
- // users: restAPI('users'),
|
|
|
- // comments: restAPI(`items/${item_id}/comments`),
|
|
|
- // project_comments: restAPI(`projects/${project_id}/comments`),
|
|
|
- // itemreactions: restAPI(`items/${item_id}/reactions`),
|
|
|
- // comment_reactions: restAPI(`comments/${comment_id}/reactions`),
|
|
|
- // project_reactions: restAPI(`projects/${project_id}/reactions`),
|
|
|
- // items: restAPI('items'),
|
|
|
+
|
|
|
+ restQiitaAPI.getQiitaPages = function() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ restAPI('items', options)
|
|
|
+ .then(function(page){
|
|
|
+ resolve(JSON.parse(page.toString()));
|
|
|
+ })
|
|
|
+ .catch(function(err){
|
|
|
+ reject(err);
|
|
|
+ })
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
return restQiitaAPI;
|
|
|
}
|