Last active
August 29, 2015 14:25
-
-
Save Marak/edfc37c8182e567c6cae to your computer and use it in GitHub Desktop.
hook.io example microservice for accessing incoming http request parameters
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
// Access incoming HTTP request data | |
module['exports'] = function accessRequestData (hook) { | |
var params = hook.params; | |
// params contains all incoming request parameters, | |
// such as query string or form data. | |
// See http://hook.io/docs#data for more information | |
// Responds back with all incoming HTTP params | |
hook.res.write(JSON.stringify(hook.params, true, 2)); | |
hook.res.end(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment