score:0

'use strict';

var express = require('express');
var router = express.Router();

var React = require('react');
var reactDom = require('react-dom/server');
var App = React.createFactory(class extends React.Component {
  render () {
    console.log(this.props);
    return React.createElement('div');
  }
});

router.get('/', function(req,res) {
    var reactHtml = reactDom.renderToString(App({exists: false}));
    res.send(reactHtml);
});

var app = express();
app.use('/', router);
app.listen(3000);

Related Query

More Query from same tag