Book Image

Meteor Cookbook

By : Isaac Strack
Book Image

Meteor Cookbook

By: Isaac Strack

Overview of this book

Table of Contents (19 chapters)
Meteor Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Basic safety – turning off autopublish


Quickly and easily accessing your data saves you an enormous amount of time when you're prototyping! The autopublish package, which is installed by default in every newly-created Meteor app, enables you to quickly manage and access your data collections, so that you can churn out great code. When the time comes, however, broadcasting every field in every data collection is inefficient and unsecure. This recipe will show you the basics of removing the autopublish package, and implementing your own publish/subscribe code to keep your app working as intended.

Getting ready

We will create a very basic application, displaying simple text cards on the screen, and then show the effects of autopublish and subscribe/publish on those cards. To do this, we need to create our folder structure, add some basic templates, and add a bit of styling.

Project setup

In a terminal window, create your root project by entering the following commands:

$ meteor create secure-autopublish...