{"size": 824, "ext": "js", "max_stars_repo_path": "src/server/modules/core/index.js", "max_stars_repo_name": "worldline/rhapidux", "max_stars_repo_stars_event_min_datetime": "2015-11-19T15:36:23.000Z", "max_stars_repo_stars_event_max_datetime": "2016-01-24T20:58:59.000Z", "max_issues_repo_path": "src/server/modules/core/index.js", "max_issues_repo_name": "worldline/rhapidux", "max_issues_repo_issues_event_min_datetime": "2016-03-01T16:00:07.000Z", "max_issues_repo_issues_event_max_datetime": "2019-01-24T14:07:21.000Z", "max_forks_repo_path": "src/server/modules/core/index.js", "max_forks_repo_name": "worldline/rhapidux", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 22.2702702703, "max_line_length": 106, "alphanum_fraction": 0.5958737864}
import React from 'react';
import { renderToString } from 'react-dom/server';
import Html from '../../../client/html.jsx';
import Root from '../../../client/components/root/root.jsx';

const register = function(server, options, next) {

  server.route({
    method: 'GET',
    path: '/bundle.js',
    handler: {
      file: '../client/bundle.js'
    }
  });

  server.route({
    method: 'GET',
    path: '/{p*}',
    handler(request, reply) {
      // Build the nodes as strings to be able to remount it client-side
      const note = renderToString(<Root />);
      const html = renderToString(<Html state={`window.state = ${JSON.stringify({})}`} remount={note} />);
      reply(`<!DOCTYPE html>${html}`);
    }
  });

  next();

};

register.attributes = {
  name: 'core',
  version: '1.0.0'
};

export default register;
