Router Smart Package

router is a Reactive Router for multipage apps

router uses the pagejs library to route urls to template. It also adds filtering which allows you to easily check permissions

  1. Since meteor-router is list with atmosphere we can install it using the mrt add command

     mrt add router
  2. Lets create our first route. Create a folder called client. Inside the folder create a file by the name routes.js


       '/': function () {
         console.log('loading home');
         return 'home';

    Notice that we return the string 'home'. The string returned is the name of the template that will be rendered when this route is called.

  3. Lets create our home template.


     <template name="home">
       <h1>Welcome Home</h1>
  4. Now we need to tell Meteor where we want to render the template. Add the {{renderPage}} to our app.html template:


       <div class="container" role="main">
         <div class="page-header">
           <a href="/">
         <div class="content">
  5. Now if you visit http://localhost:3000/ you will see:

    Welcome Home


  • atmosphere - Meteorite Smart Package site
  • router - A Reactive Router for multipage apps
  • pagejs - Micro client-side router inspired by the Express router (~1200 bytes)