Client link makes Server Route work first time, template not updated


#1

I’m new to Iron-Router so be gentle. I added links to my template and they render the URLs fine. If I add a function to the main.js on the Server it will fire a console.log() command only the first time you hit the button.

  1. error ogs
  2. template code
  3. server JS
Navigated to http://localhost:3000/register
router.js:347There is no route for the path: /registerRouter._notfoundRoute @ router.js:347(anonymous function) @ router.js:535(anonymous function) @ index.js:474nextEnter @ index.js:306page.dispatch @ index.js:312page.replace @ index.js:275self._page.(anonymous function) @ router.js:382page.start @ index.js:168page @ index.js:102Router.initialize @ router.js:391FlowRouter.initialize @ client.js:234(anonymous function) @ _init.js:9maybeReady @ startup_client.js:26loadingCompleted @ startup_client.js:38
main.js:49
 register was called
router.js:347 There is no route for the path: /aboutRouter._notfoundRoute @ router.js:347(anonymous function) @ router.js:535(anonymous function) @ index.js:474nextEnter @ index.js:306nextExit @ index.js:294page.dispatch @ index.js:310page.show @ index.js:200self._page.(anonymous function) @ router.js:382onclick @ index.js:601
router.js:347 There is no route for the path: /Router._notfoundRoute @ router.js:347(anonymous function) @ router.js:535(anonymous function) @ index.js:474nextEnter @ index.js:306nextExit @ index.js:294page.dispatch @ index.js:310page.show @ index.js:200self._page.(anonymous function) @ router.js:382onclick @ index.js:601
router.js:347 There is no route for the path: /register

main.html

<li><a href="{{pathFor 'register'}}">Register</a></li>
<li><a href="{{pathFor 'about'}}">About SMS-CMC</a></li>
<li><a href="/">Home</a></li>

main.js


Router.configure({
    layoutTemplate: 'site_template'
});


Router.route('/', function () {
	console.log( "home was called" );
	  this.render('home');
	});

Router.route('/about', function () {
	console.log( "about was called" );
	  this.render('about');
	});

Router.route('/register', function () {
	console.log( "register was called" );
	  this.render('register');
	});