Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use pm2 start express project but can't access in browser #319

Closed
Pana opened this issue Feb 22, 2014 · 7 comments
Closed

use pm2 start express project but can't access in browser #319

Pana opened this issue Feb 22, 2014 · 7 comments

Comments

@Pana
Copy link

Pana commented Feb 22, 2014

I start a express service by pm2 start app.js -i 3, but can't access the service in browser.
pm2 list show the process is good.

@soyuka
Copy link
Collaborator

soyuka commented Feb 22, 2014

Is your node application working with node app.js ?

It's not PM2 related, please don't write an issue without giving details about your server configuration, the pm2 version, the node version etc. !

@Pana
Copy link
Author

Pana commented Feb 24, 2014

I have found the reason, i have change my app.js to start server only when the process is master and not required by other file. when i use pm2 start it, the server is not started.

I also have encounter the problem that pm2 stop can't stop the process.

@soyuka soyuka added the invalid label Feb 24, 2014
@soyuka
Copy link
Collaborator

soyuka commented Feb 24, 2014

I can't understand your issue, please give more details.

I close this one as non-constructive, feel free to comment.

@soyuka soyuka closed this as completed Feb 24, 2014
@Pana
Copy link
Author

Pana commented Feb 24, 2014

Here is my code

if(!module.parent && cluster.isMaster){
    http.createServer(app).listen(app.get('port'), function(){
      console.log("Mobile Server listening on port " + app.get('port'));
    });
}

@Mr-Wiredancer
Copy link

@Pana becuz none of the process started by pm2 is master

Unitech added a commit that referenced this issue Sep 16, 2014
@noyruto5
Copy link

noyruto5 commented Apr 2, 2018

I have the same problem. Can't load api run with pm2.

@LvChengbin
Copy link

I encountered the same problem. My server was working well as starting with node server.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants