From e8e8f3a62a21fc337ee8e52e575a6cf93e5a4f94 Mon Sep 17 00:00:00 2001 From: YarnBall Date: Thu, 22 Sep 2016 00:42:59 +1000 Subject: [PATCH 1/4] Missing step- adding path the webpack.js (#224) Raised issue, asked to to PR. https://github.com/reactjs/react-router-tutorial/issues/218#issuecomment-241829117 --- lessons/11-productionish-server/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lessons/11-productionish-server/README.md b/lessons/11-productionish-server/README.md index 0dc31466..1ddfd278 100644 --- a/lessons/11-productionish-server/README.md +++ b/lessons/11-productionish-server/README.md @@ -27,6 +27,16 @@ scripts entry in package.json to look like this: }, ``` +In the root directly, go open up `webpack.config.js` and add the publicPath '/' as per below: +``` +// webpack.config.js + output: { + path: 'public', + filename: 'bundle.js', + publicPath: '/' + }, +``` + When you run `npm start` it checks if the value of our `NODE_ENV` environment variable is `production`. If yes, it runs `npm run start:prod`, if not, it runs `npm run start:dev`. From c84de30119ea732dd13a63750b1b30037667d98f Mon Sep 17 00:00:00 2001 From: Derek Bytheway Date: Wed, 21 Sep 2016 08:43:19 -0600 Subject: [PATCH 2/4] Fix RouterContext comment (#227) I make the same mistake all the time :) --- lessons/13-server-rendering/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/13-server-rendering/README.md b/lessons/13-server-rendering/README.md index 4a631854..a8aa94b7 100644 --- a/lessons/13-server-rendering/README.md +++ b/lessons/13-server-rendering/README.md @@ -152,7 +152,7 @@ import routes from './modules/routes' app.get('*', (req, res) => { // match the routes to the url match({ routes: routes, location: req.url }, (err, redirect, props) => { - // `RouterContext` is the what `Router` renders. `Router` keeps these + // `RouterContext` is what the `Router` renders. `Router` keeps these // `props` in its state as it listens to `browserHistory`. But on the // server our app is stateless, so we need to use `match` to // get these props before rendering. From d2b309185fc59b79dc38a3073fc2dfc1651a1e8a Mon Sep 17 00:00:00 2001 From: johanneserber Date: Wed, 21 Sep 2016 16:44:07 +0200 Subject: [PATCH 3/4] Dependency is not needed at this point (#230) --- lessons/11-productionish-server/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lessons/11-productionish-server/README.md b/lessons/11-productionish-server/README.md index 1ddfd278..30582eba 100644 --- a/lessons/11-productionish-server/README.md +++ b/lessons/11-productionish-server/README.md @@ -48,7 +48,6 @@ first attempt: // server.js var express = require('express') var path = require('path') -var compression = require('compression') var app = express() From 66d013c983fb722973d60fcff6a046aad1579437 Mon Sep 17 00:00:00 2001 From: blackmiaool Date: Wed, 21 Sep 2016 22:44:35 +0800 Subject: [PATCH 4/4] Fix typo (#233) --- lessons/06-params/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/06-params/README.md b/lessons/06-params/README.md index e5066a2e..d165bc7e 100644 --- a/lessons/06-params/README.md +++ b/lessons/06-params/README.md @@ -19,7 +19,7 @@ parsed out and made available to route components on ## Adding a Route with Parameters -Lets teach our app how to render screens at `/repos/:userName/:repoName`. +Let's teach our app how to render screens at `/repos/:userName/:repoName`. First we need a component to render at the route, make a new file at `modules/Repo.js` that looks something like this: