Sometimes, we want to listen all interfaces instead of localhost only with Express app server in JavaScript.
In this article, we’ll look at how to listen all interfaces instead of localhost only with Express app server in JavaScript.
How to listen all interfaces instead of localhost only with Express app server in JavaScript?
To listen all interfaces instead of localhost only with Express app server in JavaScript, we call listen
without the 2nd argument.
For instance, we write
app.listen(3000);
to listen to all interfaces on port 3000.
Conclusion
To listen all interfaces instead of localhost only with Express app server in JavaScript, we call listen
without the 2nd argument.