express app server . listen all interfaces instead of localhost only

If you don’t specify host while calling app.listen, server will run on all interfaces available i.e on 0.0.0.0

You can bind the IP address using the following code

app.listen(3000, '127.0.0.1');

If you want to run server in all interface use the following code

app.listen(3000, '0.0.0.0');

or

app.listen(3000)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)