require("request")
const request = require("request-promise")
var options = {
uri: 'https://ya.ru',
headers: {
'User-Agent': 'Request-Promise'
},
json: true // Automatically parses the JSON string in the response
};
request(options)
.then(function (repos) {
console.log(repos);
})
.catch(function (err) {
console.log(err);
// API call failed...
});
exports.endpoint = function(request, response) {
response.end("Hello world!");
}