Add dev runtime from web-starter

This commit is contained in:
Michael Jackson
2016-05-16 15:55:24 -07:00
parent 5f2615f2ed
commit 66ef9a780c
10 changed files with 382 additions and 106 deletions

View File

@ -0,0 +1,16 @@
import React from 'react'
import { renderToStaticMarkup } from 'react-dom/server'
import HomePage from './components/HomePage'
const DOCTYPE = '<!DOCTYPE html>'
export const sendHomePage = (req, res) => {
const props = {
styles: req.assets.getStyleURLs('home'),
scripts: req.assets.getScriptURLs('home')
}
res.send(
DOCTYPE + renderToStaticMarkup(<HomePage {...props}/>)
)
}