Put helpers into utils folder
This commit is contained in:
parent
d7df24b1f3
commit
9127391316
|
@ -28,10 +28,10 @@ if (process.env.NODE_ENV === 'development') {
|
||||||
|
|
||||||
app.use(require('express').static('public'))
|
app.use(require('express').static('public'))
|
||||||
|
|
||||||
var api = require('./api');
|
var api = require('./utils/api');
|
||||||
api(app);
|
api(app);
|
||||||
|
|
||||||
var serverRender = require('./serverRender')
|
var serverRender = require('./utils/serverRender')
|
||||||
app.get("*", serverRender)
|
app.get("*", serverRender)
|
||||||
|
|
||||||
app.listen(port, function(error) {
|
app.listen(port, function(error) {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
|
const compiler = {
|
||||||
|
|
||||||
|
}
|
|
@ -2,7 +2,7 @@ import 'babel-polyfill'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { renderToString } from 'react-dom/server'
|
import { renderToString } from 'react-dom/server'
|
||||||
import { StaticRouter as Router } from 'react-router-dom'
|
import { StaticRouter as Router } from 'react-router-dom'
|
||||||
import { App } from './components/App'
|
import { App } from '../components/App'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ function renderFullPage(html) {
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root">${process.env.NODE_ENV === 'production' ? html : `<div>${html}</div>`}</div>
|
<div id="root">${process.env.NODE_ENV === 'production' ? html : `<div>${html}</div>`}</div>
|
||||||
<script src="/static/vendor.js"></script>
|
|
||||||
<script src="/static/bundle.js"></script>
|
<script src="/static/bundle.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue