Tuesday, 8 October 2019

where is node port?

Hello, I build a mern stack app. And working perfectly when runs on two ports for server and client, the client runs on 3000 and server runs on 4000After I build the react client and server and runs on production,src - db - gql - routers - www (I store react build on this folder) - index.js // code to run on production on index.js if(NODEENV === 'production') { const wwwPath = path.join(_dirname, 'www'); app.use('/', express.static(wwwPath)); }and when I start the index.js server starts and on port 4000 if I go to port 4000 I see react application and how can I access the server port to connect with the client

Submitted October 08, 2019 at 06:49PM by Chawki_

No comments:

Post a Comment