Iron:router doesn't work with the react-router-ssr


#1

Recently, I’ve built my project based on this repo.

It provides ssr in production and hmr in development, which is very convenient.

But I still need a RESTful API end points for other applications.
I start to try on iron:router by following the guide on meteor chef.
At first, it keep showing the splash page.
( iron:router Organize your Meteor application … and something else.)
So I found some solution on SO and meteor forum.
The most common solution is : configure a not found template

I do exactly what it said:
Put a template in main.html,
then configure a not found template in routes.js:

Router.configure({
  notFoundTemplate: 'pageNotFound',
});

The file location is here
Configuring the router before the SSR executing.

Then the router keep showing both my react-app and the splash page.
I took a further trying by add other routes to iron:router:

Router.route('/', function () {
  console.log('index')
  this.render('emtyTemplate');
});

Router.route('/yo', function () {
  console.log('yo')
  this.render('yo');
});

I’ve already defined the yo template and emptyTemplate in main.html

I got nothing different, which is a little too surprising for me.
Even don’t have any result from console.log,
which means neither server and client do know iron:router had configured any route.

Any suggestion would be very helpful.

Maybe there need somebody to take over the repos in reactivestack,
(The author might took a long vacation …)
It might level up developer’s productivity which is MeteorJS keep emphasizing :smiley:
The way they integrate with webpack and meteor is super awesome