Last active
August 29, 2015 14:27
-
-
Save palmerabollo/907d4a6cc19cd260b9c4 to your computer and use it in GitHub Desktop.
My first hook.io microservice
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
| module['exports'] = function saveExternalIp (hook) { | |
| var params = hook.params; | |
| var store = hook.datastore; | |
| var obj = { ip: params.ip, date: new Date() }; | |
| store.set('externalip', obj, function(err, result) { | |
| if (err) { | |
| return res.end(err.message); | |
| } | |
| // See http://hook.io/docs#data for more information | |
| hook.res.write(JSON.stringify(obj)); | |
| hook.res.end(); | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment