Skip to content

Commit 114411e

Browse files
author
Michael Johnston
committed
Add options for specifying connect and live reload ports.
1 parent 0146a0b commit 114411e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,6 @@ npm install
175175
npm start
176176
```
177177

178-
This will start a live reloading server on port 8080.
178+
This will start a live reloading server on port 8080. To override the default server and live reload ports, run `npm start` with PORT and/or RELOAD_PORT environment variables.
179179

180180
**A note on NODE_ENV and React**: running the examples with `NODE_ENV=production` will noticeably improve scrolling performance. This is because React skips propType validation in production mode.

gulpfile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ var connect = require('gulp-connect');
44
var webpack = require('gulp-webpack');
55
var webpackConfig = require('./webpack.config.js');
66

7+
var port = process.env.PORT || 8080;
8+
var reloadPort = process.env.RELOAD_PORT || 35729;
9+
710
gulp.task('clean', function () {
811
del(['build']);
912
});
@@ -16,7 +19,10 @@ gulp.task('build', function () {
1619

1720
gulp.task('serve', function () {
1821
connect.server({
19-
livereload: true
22+
port: port,
23+
livereload: {
24+
port: reloadPort
25+
}
2026
});
2127
});
2228

0 commit comments

Comments
 (0)