I've searched for this three times this week, so I figured I'd better make sure I have a copy of it:
python -m SimpleHTTPServer 8000
Navigate to the project directory in the terminal and do that command. Then http://localhost:8000 will server up that directory (as in, it's `index.html` file).
It can be very useful to spin up a quick server.
php -S localhost:8000also works in recent versions.This command requires PHP 5.4.0 and above
Requires installation, but with Node:
Once installed, you can run from any directory:
I use “http-server” regularly. It is simpler and easy to remember.