-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a1d873
commit 9c0f178
Showing
9 changed files
with
110 additions
and
961 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// :global { | ||
// body { | ||
// background-color: #fefefe; | ||
// height: 300vh; | ||
// font-family: Futura, Helvetica, sans-serif; | ||
// font-size: 20px; | ||
// color: #222222; | ||
// } | ||
// } | ||
:global { | ||
body { | ||
background-color: #fefefe; | ||
height: 300vh; | ||
font-family: Futura, Helvetica, sans-serif; | ||
font-size: 20px; | ||
color: #222222; | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import path from 'path'; | ||
import fs from 'fs'; | ||
import express from 'express'; | ||
|
||
import React from 'react'; | ||
import ReactServer from 'react-dom/server'; | ||
import { App } from 'components'; | ||
|
||
import 'babel-polyfill'; | ||
|
||
const server = express(); | ||
|
||
const dist = path.resolve(__dirname, '../dist'); | ||
|
||
server.use('/static', express.static(dist)); | ||
|
||
server.get('/', (req, res) => { | ||
const html = fs | ||
.readFileSync(path.resolve(__dirname, './index.html')) | ||
.toString(); | ||
|
||
const markup = ReactServer.renderToString(<App />); | ||
|
||
const htmlDoc = html.replace('%%_REACT_%%', markup); | ||
|
||
res.send(htmlDoc); | ||
}); | ||
|
||
server.listen(3000, () => { | ||
console.log('Listening on: http://localhost:3000'); | ||
}); |
Oops, something went wrong.