Skip to content

Instantly share code, notes, and snippets.

@krstoff
Created May 28, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save krstoff/bdc1698b067a7854a9ce988e047f0d3a to your computer and use it in GitHub Desktop.
Save krstoff/bdc1698b067a7854a9ce988e047f0d3a to your computer and use it in GitHub Desktop.
/// Handler for /travel/{url}
module.exports.travel = (event, context, callback) => {
// Get the url from the resource path.
// Get the html.
// Turn it into a successful request.
// Attach the Node.js callback onto the end.
var url = getURLFromPath(event.path);
var htmlPromise = url.then(getFromURL);
var response = htmlPromise.then(make200Reponse);
response.asCallback(callback)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment