Skip to content

Instantly share code, notes, and snippets.

@RafaPegorari
Created December 28, 2017 12:19
Show Gist options
  • Save RafaPegorari/82f918deadd9474c5afc8b77dd631bd4 to your computer and use it in GitHub Desktop.
Save RafaPegorari/82f918deadd9474c5afc8b77dd631bd4 to your computer and use it in GitHub Desktop.
/**
* GET /
*/
exports.index = function (req, res) {
jiraResponse(req.params.key);
res.render('story', {
//title: jiraResponse(req.params.key)
});
};
let jiraResponse = function (key) {
let request = require('request-promise');
let url = "https://ihm-software.atlassian.net/rest/api/2/issue/x1-1098";
//auth = "Basic " + new Buffer(username + ":" + password).toString("base64");
console.log('request');
request(
{
url: url,
headers: { "Authorization": "Basic bGNhbnRlbGxpOmQzMGs1MFhh" },
json: true
}
).then(function (response) {
console.log('then');
}).finally(function() {
console.log('finally');
});
console.log('fim request');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment