Skip to content

Commit 5397f54

Browse files
committed
Change port to 3000 and add console output to the webpack server
1 parent c281676 commit 5397f54

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

docs/introduction/Examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ cd redux/examples/universal
7575
npm install
7676
npm start & npm run client
7777
78-
open http://localhost:8080/
78+
open http://localhost:3000/
7979
```
8080

8181
It covers:

examples/universal/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import App from './containers/App';
88
import { fetchCounter } from './api/counter';
99

1010
const app = Express();
11-
const port = 8080;
11+
const port = 3000;
1212

1313
// Use this middleware to server up static files built into dist
1414
app.use(require('serve-static')(path.join(__dirname, 'dist')));
@@ -67,6 +67,6 @@ app.listen(port, (error) => {
6767
if (error) {
6868
console.error(error);
6969
} else {
70-
console.info('==> 🌎 Listening on port 8080. Open up http://localhost:8080/ in your browser.');
70+
console.info(`==> 🌎 Listening on port ${port}. Open up http://localhost:${port}/ in your browser.`);
7171
}
7272
});

examples/universal/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var path = require('path');
22
var webpack = require('webpack');
33
var host = 'localhost';
4-
var port = 3000;
4+
var port = 3001;
55

66
module.exports = {
7+
devServerPort: port,
78
devtool: 'inline-source-map',
89
entry: [
910
'webpack-dev-server/client?http://' + host + ':' + port,

examples/universal/webpack.server.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ new WebpackDevServer(webpack(config), {
88
publicPath: config.output.publicPath,
99
hot: true,
1010
historyApiFallback: true,
11+
noInfo: true,
1112
headers: {'Access-Control-Allow-Origin': '*'},
1213
stats: {
1314
colors: true
1415
}
15-
}).listen(3000, 'localhost', function errorCallback(err) {
16+
}).listen(config.devServerPort, 'localhost', function errorCallback(err) {
1617
if (err) {
17-
console.log(err);
18+
console.error(err);
1819
}
1920

20-
console.log('Listening at localhost:3000');
21+
console.info(`==> 🚧 Webpack development server listening on port ${config.devServerPort}`);
2122
});

0 commit comments

Comments
 (0)