Last Updated: February 20, 2016
·
566
· bobuss

Serve your current directory by a web server

So you have some static html, css and js files to quickly have a look on ?

$ ls -l
total 24
drwxr-xr-x  4 bobuss  staff    136 18 jui 23:24 css
drwxr-xr-x  6 bobuss  staff    204 18 jui 23:29 img
-rw-r--r--  1 bobuss  staff  10711 18 jui 23:23 index.html
drwxr-xr-x  3 bobuss  staff    102 11 jui 13:02 js

Use the python force, Luke !

$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...

Then open your browser and go to the url:

127.0.0.1:8000

TIP : on your mac, you can achieve the last task by typing

open http://127.0.0.1:8000