Skip to content

Commit

Permalink
added prerender
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramsay Lanier committed Feb 4, 2016
1 parent 3abd929 commit ed6d46d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"startdev": "NODE_ENV=dev babel-node --debug ./server.js",
"startdevprod": "NODE_ENV=production babel-node --debug ./server.js",
"build-server": "babel -d ./dist ./server.js ./webpack.config.js",
"build-schema": "babel -d ./dist/data ./data",
"build-settings": "cp -R ./settings ./dist/",
"build-schema": "babel -d ./dist/schema ./schema",
"build-settings": "cp -R ./settings ./dist/ && babel -d ./dist/settings ./settings",
"build": "rimraf dist && NODE_ENV=production webpack --config ./webpack.production.config.js --progress --profile --colors && npm run build-server && npm run build-schema && npm run build-settings",
"deploy": "bash scripts/deploy.sh",
"eslint": "eslint .",
Expand All @@ -56,6 +56,7 @@
"mysql": "^2.10.0",
"npm": "^3.5.3",
"php-unserialize": "0.0.1",
"prerender-node": "^2.2.0",
"react": "^0.14.5",
"react-css-modules": "^3.6.4",
"react-dom": "^0.14.5",
Expand Down Expand Up @@ -102,7 +103,7 @@
"null-loader": "^0.1.1",
"postcss-loader": "^0.6.0",
"react-addons-test-utils": "^0.14.3",
"react-relay": "^0.6.0",
"react-relay": "^0.6.1",
"react-transform-catch-errors": "^1.0.0",
"react-transform-hmr": "^1.0.0",
"redbox-react": "^1.2.0",
Expand Down
4 changes: 3 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import config from './webpack.config.js';
import {graphql} from 'graphql';
import graphqlHTTP from 'express-graphql';
import Schema from './schema/schema';
import { privateSettings } from './settings/settings';

const isDeveloping = process.env.NODE_ENV !== 'production';
const APP_PORT = isDeveloping ? 3100 : process.env.PORT || 3000;
Expand Down Expand Up @@ -51,11 +52,12 @@ if (isDeveloping) {
app.use(webpackHotMiddleware(compiler));

} else {
app.use(require('prerender-node').set('prerenderToken', privateSettings.prerenderToken ));
app.use(express.static('./dist'));
app.use('/graphql', graphqlHTTP(request => ({
graphiql: true,
pretty: true,
schema: WordExpressSchema,
schema: Schema,
})
));
app.get('*', function response(req, res, next) {
Expand Down

0 comments on commit ed6d46d

Please sign in to comment.