access gitlab api by using node, support v4
$ npm install gitlab-node --save
- Use private token
// url is your gitlab api path such as http://example.com/api/v4/
// token is your user private token
const gitlab = require('gitlab-node').connect(url, token);
gitlab.issues.proejcts(projectId).then(function(issues) {
// do something
});
- Use oauth2 token
// url is your gitlab api path such as http://example.com/api/v4/
// token is your oauth2 token
const gitlab = require('gitlab-node').connect(url, token, true);
gitlab.issues.proejcts(projectId).then(function(issues) {
// do something
});
See detail