Skip to content

Instantly share code, notes, and snippets.

@aroach
Created April 24, 2017 22:31
Show Gist options
  • Save aroach/c93bc70edf68becbd65ee09c33365582 to your computer and use it in GitHub Desktop.
Save aroach/c93bc70edf68becbd65ee09c33365582 to your computer and use it in GitHub Desktop.
Example functions
'use strict'
var https = require('https');
exports.handler = (context, callback) => {
// Add your code here
request(
{
url: 'https://api.github.com/users/aroach/gists',
headers: {
'accept': 'application/json',
'user-agent': 'ashley-glue'
}
}, function(error, response, body) {
logger.info("Finished");
logger.info("body:", body);
logger.info("error:", error);
logger.info("response:", response && response.statusCode);
// Most likely put your callback() here
callback(body);
});
};
'use strict'
var https = require('https');
exports.handler = (context, callback) => {
// Add your code here
callback(JSON.stringify({"result": context[0].url}));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment