kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 195 forks source link

Wait for async data for SSR #702

Open semeano opened 7 years ago

semeano commented 7 years ago

Is it possible to make an Ajax call and wait for the response before render (on server-side)?

Basically I want to do something like this:

FlowRouter.route('/bazinga', {
  name: 'bazinga',
  action() {
    if (Meteor.isServer) {
      getData(query, function callback(data) {
        mount(...);
      }
    }
  }
});

Any help would be appreciated. Thanks.