Created
May 28, 2017 20:06
-
-
Save krstoff/bdc1698b067a7854a9ce988e047f0d3a to your computer and use it in GitHub Desktop.
This file contains 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. | |
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