Skip to content

MeteorJS - Router

2014-06-03 23:16:11

Install Meteor curl | sh

If you don't have nodeJs install form (somthing like this sudo apt-get install nodejs)

Install Meteorite for Meteor sudo npm install -g meteorite

Add Router package to Meteor sudo add iron-router

Create new application meteor create appname

Run app meteor

if (Meteor.isClient) { () {
        this.route('home', {path: '/'})
        this.route('post', {path: '/post'});
        this.route('about', {path: '/about'});


if (Meteor.isServer) {
    Meteor.startup(function () {
        // code to run on server at startup


<a href='"/"'>Home</a>
<a href='"/post"'>Post</a>
<a href='"/about"'>About</a>

<template name='"home"'>

# Home

<template name='"about"'>

# About

<template name='"post"'>

# Post