O'Reilly logo

Meteor Cookbook by Isaac Strack

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building custom server methods

The majority of communications we perform between the client and server in Meteor is done via DDP. There are times, however, where direct server calls can come in very handy. For example, while you're testing, or as an admin, you may create some 'hidden' helper methods to make debugging easier. In other instances, you may want to make very secure or very simple methods available to reduce the vulnerability or complexity of your code. In any case, server methods are a staple of development, and this recipe will walk you through creating and using server-side methods, using the Meteor.methods() function.

Getting ready

To create server methods, we first need a basic application. We'll quickly create a color swatch app. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required