Saturday 20 May 2017

why react webport server port not conflict with node.js server port

I am running my react by using webpack-dev-server and script like this:

"build": "webpack -d && cp src/index.html ../personal_web_nodejs/views/index.ejs && webpack-dev-server --content-base src/ --inline --hot --history-api-fallback --port 8080",

I am putting it in port 8080. and after I run, the console shows: react console

However, I am also running my node.js server on 8080:

var port = normalizePort(process.env.PORT || '8080');

and the server can be run without saying the port is been used. node.hs console

I am kind of confused what exactly I am running? Anyone can explain me why and how I can run two servers with same port number?



via Lee

No comments:

Post a Comment