Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142239

How can i display the ip address exposing an express.js development server to other machines in the network?

$
0
0

When I start up a basic express.js server I usually console.log a message that says it is running and listening on port .

const express = require('express');
const app = express();
const port = 3000;

app.get('/', (req, res) => res.send('App reached.'));

app.listen(port, () => console.log(`Example app listening on port ${port}!`));

However, I would like to add to this message the available IP address exposing the app to other machines on the network. Somewhat like create-react-app basic template does. How can i reach that info with my javascript code?


Viewing all articles
Browse latest Browse all 142239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>