From 912739131616c29f9bcd1b8f7fae36d58e77702a Mon Sep 17 00:00:00 2001 From: LordMathis Date: Fri, 27 Oct 2017 14:37:12 +0200 Subject: [PATCH] Put helpers into utils folder --- src/server.js | 4 ++-- src/{ => utils}/api.js | 0 src/utils/compiler.js | 5 +++++ src/{ => utils}/serverRender.js | 3 +-- 4 files changed, 8 insertions(+), 4 deletions(-) rename src/{ => utils}/api.js (100%) create mode 100644 src/utils/compiler.js rename src/{ => utils}/serverRender.js (93%) diff --git a/src/server.js b/src/server.js index 79adac4..4c4063b 100644 --- a/src/server.js +++ b/src/server.js @@ -28,10 +28,10 @@ if (process.env.NODE_ENV === 'development') { app.use(require('express').static('public')) -var api = require('./api'); +var api = require('./utils/api'); api(app); -var serverRender = require('./serverRender') +var serverRender = require('./utils/serverRender') app.get("*", serverRender) app.listen(port, function(error) { diff --git a/src/api.js b/src/utils/api.js similarity index 100% rename from src/api.js rename to src/utils/api.js diff --git a/src/utils/compiler.js b/src/utils/compiler.js new file mode 100644 index 0000000..d99990f --- /dev/null +++ b/src/utils/compiler.js @@ -0,0 +1,5 @@ + + +const compiler = { + +} diff --git a/src/serverRender.js b/src/utils/serverRender.js similarity index 93% rename from src/serverRender.js rename to src/utils/serverRender.js index 0a350eb..dfb1684 100644 --- a/src/serverRender.js +++ b/src/utils/serverRender.js @@ -2,7 +2,7 @@ import 'babel-polyfill' import React from 'react' import { renderToString } from 'react-dom/server' 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) {
${process.env.NODE_ENV === 'production' ? html : `
${html}
`}
-