evertonrobertoauler / cli-universal-demo

80 stars 18 forks source link

listen in 0.0.0.0 #26

Closed danvelcab closed 7 years ago

danvelcab commented 7 years ago

Hi. I changed the file sever.js to listen in 0.0.0.0 but I can not get it to work. Can anybody help me. This is the code?:

app.listen(PORT, "0.0.0.0" () => {
  console.log(`listening on http://localhost:${PORT}!`);
});

Thanks

evertonrobertoauler commented 7 years ago

Hi, It could be your firewall that is blocking the PORT access for other machines in your local network, I use the following code: app.listen(PORT, () => { console.log(listening on http://localhost:${PORT}!); }); And it works fine, I can access my app from my smartphone in the same network without the need of passing 0.0.0.0 as the second listen parameter

danvelcab commented 7 years ago

I'm sorry. Thanks you for the repply but it was a problems with ports.