Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the port number 8081 of mongo-express

I need to change mongo-express port number from 8081 to 8082. Because 8081 is use by react-native. Anyone knows how to do that?

like image 408
Sydney Avatar asked Sep 12 '25 05:09

Sydney


1 Answers

In Mongo-Express the port is defined in config.default.js as:

port: process.env.VCAP_APP_PORT || 8081

If you copy config.default.js to config.js as they suggest in the the README you can change the port to whatever you like. Alternatively, as you can see, you can also set the VCAP_APP_PORT environmental variable with something like:

export VCAP_APP_PORT=8082
like image 58
Mark Avatar answered Sep 13 '25 21:09

Mark