Expose a web server on local network

  1. Connect your laptop and phone to the same network (Wi-Fi is a network too).

  2. Create a index.html file to share:

  1. Start a web server in the same directory as the file:
ruby -run -e httpd -- --bind-address= --port=9090
  1. Find your hostname, or ip address:
# my-pc

ip addr
# ... some wall of text, one line containing something like:
# inet ...
  1. Now you can use either your hostname or ip address to access your web page from your phone:
  1. Install Termux on your phone and do the exact same to access web pages from your laptop.