commit 2da58da1b252e1a6502319cc414d556453b96450
parent 5a7cf3442d646dd2f0d0cf4b9d07fa1129428ac0
Author: Konstantin Tarkus <hello@tarkus.me>
Date: Fri, 26 Feb 2016 19:50:14 +0300
Change the default Node.js server port from 5000 to 3000
3000 - Node.js application server
3001 - BrowserSync proxy with HMR / React Hot Transform
3002 - BrowserSync UI (only in debug/development mode)
Close #387, close #464
Diffstat:
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
### [Unreleased][unreleased]
+- Change the default Node.js server port from `5000` to `3000`
+- Add a JWT-based authentication cookies (see `src/server.js`)
+- Add a reference implementation of Facebook authentication strategy (`src/core/passport.js`)
+- Add a sample database client utility for PostgreSQL (`src/core/db.js`)
- Optimize the `tools/start.js` script that launches dev server with Browsersync and HMR
- Replace Superagent with WHATWG Fetch library
- Rename `app.js` to `client.js` (aka client-side code)
diff --git a/src/config.js b/src/config.js
@@ -10,7 +10,7 @@
/* eslint-disable max-len */
/* jscs:disable maximumLineLength */
-export const port = process.env.PORT || 5000;
+export const port = process.env.PORT || 3000;
export const host = process.env.WEBSITE_HOSTNAME || `localhost:${port}`;
export const databaseUrl = process.env.DATABASE_URL || 'postgresql://demo:Lqk62xg6TBm5UhfR@demo.ctbl5itzitm4.us-east-1.rds.amazonaws.com:5432/membership01';
diff --git a/tools/start.js b/tools/start.js
@@ -17,6 +17,8 @@ import webpackConfig from './webpack.config';
import clean from './clean';
import copy from './copy';
+const DEBUG = !process.argv.includes('--release');
+
/**
* Launches a development web server with "live reload" functionality -
* synchronizing URLs, interactions and code changes across multiple devices.
@@ -86,11 +88,14 @@ async function start() {
if (!err) {
const bs = Browsersync.create();
bs.init({
+ ...(DEBUG ? {} : { notify: false, ui: false }),
proxy: {
target: host,
middleware: [wpMiddleware, ...hotMiddlewares],
},
+ notify: DEBUG,
+
// no need to watch '*.js' here, webpack will take care of it for us,
// including full page reloads if HMR won't work
files: ['build/content/**/*.*'],