I am working on meteor with the iron:router package. My javascript file contains:
Router.route('/', function () {
this.render('home');
}, {
name: 'home'
});
Router.route('/hello', function () {
this.render('hello');
});
My html file contains:
<head>
<title>test</title>
</head>
<body>
<h1>Welcome to Meteor!</h1>
</body>
<template name="hello">
<button>Click Me</button>
<p>You've pressed the button {{counter}} times.</p>
</template>
<template name="home">
<h2>Home</h2>
<p>You are on the home screen.</p>
</template>
Whatever I write (localhost:3000/hello or localhost:3000/) as specified in the tutorial, no matter what it will NOT render any template at all. It simply displays the header "Welcome to Meteor!" and that's it.
When I write any other non-declared address such as localhost:3000/abc, it shows me:
Welcome to Meteor! Oops, looks like there's no route on the client or the server for url: "http://localhost:3000/abc."
So it definitely is doing something right in the javascript file, since it recognizes the templates it should know, but still when writing the right address, it shows nothing.
I tried looking at other solutions, check that the package name was "iron:router" and not "iron-router", as well as other solutions, but nothing has worked. Please help me...
Edit: As requested, here is a repository of the project https://github.com/yokhen/test2

bodytags). Otherwise if it were routes problem you would see something likeWhooops, route for ... doesn't exist. Where do you have your routes .js file? In lib directory? - sdooo