Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joepie91/cbe6b09618c951765c05154fa5ccba13 to your computer and use it in GitHub Desktop.
Save joepie91/cbe6b09618c951765c05154fa5ccba13 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.
return Promise.try(() => {
return getURLFromPath(event.path);
}).then((url) => {
return getFromURL(url);
}).then((response) => {
return make200Response(response);
}).asCallback(callback);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment