If you have multiple laptops on the same wifi router, you can access one machine from another by using their private IP address. This is a mild version of deploying your app on your local network (or whats called the intranet)

Screenshot 2025-01-25 at 6.54.28 PM.png

Steps to follow

  1. Start a node.js process locally on port 3000
const express = require('express');
const app = express();
const port = 3000;

app.get('/', (req, res) => {
  res.send('Hello, World!');
});

app.listen(port, () => {
  console.log(`Server is running on <http://localhost>:${port}`);
});
  1. Find the IP of your machine on the local network
ifconfig or ipconfig

Loopback address

Screenshot 2025-01-25 at 6.57.22 PM.png

Ethernet 0 network

Screenshot 2025-01-25 at 6.58.32 PM.png

If I go to 192.168.1.3:3000 on my phone, I should be able to visit the website

Screenshot 2025-01-25 at 7.01.44 PM.png

Hosts file

You can override what your domain name resolves to by overriding the hosts file.

vi /etc/hosts
127.0.0.01	harkirat.100xdevs.com

Screenshot 2025-01-25 at 7.02.55 PM.png

Can you think of how you can phis your friend into giving their credentials by using this approach?