Forked from krstoff/gist:bdc1698b067a7854a9ce988e047f0d3a
Last active
May 28, 2017 20:09
-
-
Save joepie91/cbe6b09618c951765c05154fa5ccba13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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