Server side render method, takes care of preparing the context for rendering and rendering it into html markup and destroying the context.

Options

Accepts all options from getPageContext in addition to the options outlined below.

📘

Isomorphic Implementation

This function is normally used in conjunction with the dehydrate option to give server side access to the state and markup for delivery to the client.

Example Usage

An example universal hapi handler

function appHandler(request, reply) {
  var context = fluxApp.createContext();

  return context.renderToString(request.path, {
    method: request.method,
    dehydrate: true,
  }).then((page) => {
    var markup = page.element;
    
    if (! markup) {
      Boom.notFound();
    } else {
      reply(Mustache.render(indexTemplate, {
        page: markup,
        state: JSON.stringify({
          state: page.state,
          method: page.method,
        }),
      })).code(200);
    }
  }).catch(reply);
}

👍

On to getActionType