gyorgy.sh, home
gyorgy.sh, home
How-to#CLI

Serve a folder over HTTP in one line

Updated Jul 4, 2026 1 min

When I need to preview a static site or share a folder on my network for a minute, I do not want to set up a project. These one-liners serve the current directory over HTTP with tools that are already installed.

Python (already on macOS and most Linux)

python3 -m http.server 8000

Then open http://localhost:8000. Heads up: by default it already listens on every interface, so anyone on your network can reach it. When I only want it for myself, I bind it to loopback:

python3 -m http.server 8000 --bind 127.0.0.1

Node, without installing anything

npx serve .

npx fetches serve on the fly and runs it. It prints both a local and a network URL, and handles single-page-app routing better than the Python one.

PHP, if it happens to be around

php -S localhost:8000

Which one I pick

For a plain folder of files, the Python server is the fastest thing that is always there. For anything that behaves like an app (client-side routing, clean URLs), npx serve saves me the headaches.

More in How-to

Use Claude Code remotely from your phone or the web
Step away from your desk without stopping a Claude Code run. Turn on remote control and pick the session up from your phone, claude.ai/code, or another machine.
#Claude#Remote
Stop running one giant chat: manage context in Claude Code
A long-running Claude Code session gets slower, pricier, and less accurate. How I keep context lean, and what a big context window actually costs you.
#Claude#Context
/clear, /compact, or a new session: when to reset Claude Code
Claude Code gives you two ways to trim a session and a third option to start over. /clear wipes, /compact summarizes, and a simple rule tells you which one the moment calls for.
#Claude#Context
Plan before you build: getting the most out of plan mode
Plan mode makes Claude Code lay out its approach and wait for your sign-off before it touches a file. I use it to skip the expensive redo loop.
#Claude#Workflow