Routes not define error

Hi,
I am new in meteor .
I have create NewJobPost .html (template name=“NewJobPost”)page in client folder
and add routes in the client/main.js and Server/main.js

 Router.route('/', function () {
      this.render('Home')
     Route.route('/NewJobPost');
 })

Whenever I navigate on this Using Router.go(‘NewJobPost’) , it is working fine .But when i am reloading the page or hit url “http://ocalhost:3000/NewJobPost”.

It gives me error
Oops, looks like there’s no route on the client or the server for url: "http://localhost:3000/NewJobPost."

Please help !!

Since you’ve put Route.route('/NewJobPost'); inside the callback function of the “/” route, the route will only be defined once you visit the “/” route.

What you probably want is this:

Router.route('/', {
  name: 'Home',
  template: 'Home'
});
Router.route('/NewJobPost', {
  name: 'NewJobPost',
  template: 'NewJobPost'
});

Thanks, it Worked for me