I'm currently working on a project and I would like to test it from another computer or phone. This computer is connected on the same network.
How can I connect to http://localhost:3000
?
I'm using expressjs
(nodejs
module ) as server.
Configure your application to run on 0.0.0.0
instead of 127.0.0.0(localhost)
. For example:
app.listen(3000, '0.0.0.0', function() {
console.log('Listening to port: ' + 3000);
});
Then from another computer, connect to 192.168.1.11:3000
(or whatever your local IP address is).