Created
December 11, 2014 13:08
-
-
Save gergelyke/cbc6836ae92203177b3d to your computer and use it in GitHub Desktop.
Hapi server method
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
| var fetch = function (username, next) { | |
| // get tweets from the twitter API | |
| next(null, tweets); | |
| }; | |
| server.method({ | |
| name: 'twitter.fetch', | |
| method fetch | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, loved the article, and was wondering if
methodon line 8 should have a colon next to it in the options object forserver.method(). I made the edit on a fork, I don't think there's a way to make pull requests 😦