~/Projects/static-app > python -m SimpleHTTPServer
This was the perfect solution for me.
SimpleHTTPServer is a Python library and when you send that to Python with the
-m flag it tells Python to run the library as a script. Running this within the root of your static file project just fires up a web server at http://localhost:8000.
There is also a PHP version that will actually read a
.htaccess file so you don’t have to use Apache.
~/Projects/static-app > php -S localhost:8000
This is perfect for:
- Wireframing and protoyping
- Designers converting their PSDs into static templates who don’t want to deal with build tools right away
The next time you need something really basic to run a HTML/CSS/JS app try it out for a quick win.