Created
June 13, 2016 12:38
-
-
Save chuck0523/af2f5984b67c9b87133885d00ba1d805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express' | |
import React from 'react' | |
import ReactDOMServer from 'react-dom/server' | |
import Counter from './components/Counter' | |
const app = express() | |
app.get('/', (req, res) => { | |
res.send( | |
ReactDOMServer.renderToString( | |
<Counter /> | |
) | |
) | |
}) | |
app.listen(3000, () => { | |
console.log('Example app listening on port 3000!') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment