Skip to content

Instantly share code, notes, and snippets.

@gergelyke
Created December 11, 2014 13:08
Show Gist options
  • Save gergelyke/cbc6836ae92203177b3d to your computer and use it in GitHub Desktop.
Save gergelyke/cbc6836ae92203177b3d to your computer and use it in GitHub Desktop.
Hapi server method
var fetch = function (username, next) {
// get tweets from the twitter API
next(null, tweets);
};
server.method({
name: 'twitter.fetch',
method fetch
});
@jakepruitt
Copy link

Hey, loved the article, and was wondering if method on line 8 should have a colon next to it in the options object for server.method(). I made the edit on a fork, I don't think there's a way to make pull requests 😦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment