Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Meteor: Full-Stack Web Application Development

You're reading from   Meteor: Full-Stack Web Application Development Rapidly build web apps with Meteor

Arrow left icon
Product type Course
Published in Nov 2016
Publisher Packt
ISBN-13 9781787287754
Length 685 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Fabian Vogelsteller Fabian Vogelsteller
Author Profile Icon Fabian Vogelsteller
Fabian Vogelsteller
Marcelo Reyna Marcelo Reyna
Author Profile Icon Marcelo Reyna
Marcelo Reyna
Arrow right icon
View More author details
Toc

Appendix A. Appendix

This appendix contains a list of Meteor's command-line tool commands and a short description of iron:router hooks.

List of Meteor's command-line tool commands

Option

Description

run

Using meteor run is the same as using meteor. This will start a Meteor server for our app and watch file changes.

create <name>

This will initialize a Meteor project by creating a folder with the same name with some initial files.

update

This will update our current Meteor app to the latest release. We can also use meteor update --release xyz to fix our Meteor app to a specific release.

deploy <site name>

This will deploy our Meteor app to<site name>.meteor.com.

We can pass the --delete option to remove a deployed app

build <folder_name>

This will create a folder with our bundled app(s) code ready to be deployed on our own server.

add/remove <package name>

This will add or remove a Meteor core package to/from our project.

list

This will list all Meteor packages our app is using.

mongo

This will give us access to our local MongoDB shell. We need to also have our application started with meteor run at the same time.

If we need access to the mongo database of a app deployed on meteor.com, use $ meteor mongo yourapp.meteor.com --url

But be aware that these credentials are only valid for 1 minute.

reset

This will reset our local development database to a fresh state. This won't work when our application is running. Be aware that this will remove all our data stored in our local database.

logs <site name>

This will download and display the logs for an app we deployed at <site name>.meteor.com

search

This searches for Meteor packages and releases, whose names contain the specified regular expression.

show

This shows more information about a specific package or release: name, summary, the usernames of its maintainers, and, if specified, its home page and Git URL.

publish

This publishes our packages. We must before go to the package folder using the cd command, log in to our Meteor account using $ meteor login.

To publish a package for the first time, we use $ meteor publish --create.

publish-for-arch

This publishes a build of an existing package version from a different architecture. Our machine must have the right architecture to be able to publish for a specific one.

Currently, the supported architectures for Meteor are 32-bit Linux, 64-bit Linux, and Mac OS. The servers for Meteor deploy run with a 64-bit Linux.

publish-release

This publishes a release of Meteor. This takes in a JSON configuration file.

For more detail, visit https://docs.meteor.com/#/full/meteorpublishrelease.

claim

This claims a site deployed with an old Meteor version with our Meteor developer account.

login

This logs us in to our Meteor developer account.

logout

This logs us out of our Meteor developer account.

whoami

This prints the username of our Meteor developer account.

test-packages

This will run tests for one or more packages. For more information, refer to Chapter 12, Testing with Meteor.

admin

This catches for miscellaneous commands that require authorization to use.

Some example uses of meteor admin include adding and removing package maintainers and setting a home page for a package. It also includes various help functions for managing a Meteor release.

The iron:router hooks

The following table contains a list of router controller hooks:

action

This function can overwrite the default behavior of the route. If we define this function, we have to manually render the template using this.render().

onBeforeAction

This function runs before the route gets rendered. Here, we can put extra custom actions.

onAfterAction

This function runs after the route gets rendered. Here, we can put extra custom actions.

onRun

This function runs once when the route is first loaded. This function doesn't run again on a hot code reloads or when the same URL is navigated again.

onRerun

This function will be called every time the route is called.

onStop

This function runs once when leaving the current route to a new route.

subscriptions

This function can return subscription(s) that affect this.ready() in the action hooks

waitOn

This function can return subscription(s), but will automatically render the loadingTemplate until those are ready.

data

The return value of this function will be set as the data context of this routes template.

A full explanation of these hooks can be found at the following resources:

You have been reading a chapter from
Meteor: Full-Stack Web Application Development
Published in: Nov 2016
Publisher: Packt
ISBN-13: 9781787287754
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image