Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created June 30, 2020 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/083a5649956bd5aaaf8a537a4e601a7f to your computer and use it in GitHub Desktop.
Save miguelmota/083a5649956bd5aaaf8a537a4e601a7f to your computer and use it in GitHub Desktop.
Node.js express ip address
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => res.send(req.connection.remoteAddress))
app.listen(port, () => console.log(`Listening on http://localhost:${port}`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment