simple http server for HTML5/JS dev
Using a Mac or Linux
and you are developing HTML or JavaScript stuff?
Guess you have often wondered how to open a simple http server at the current location in the terminal?
Here is a one-liner that requires Python.
Execute in the Shell:
python -m SimpleHTTPServer
That will start a small http server on port 8000.
You may also specify a custom port at the end if you want.
python -m SimpleHTTPServer [port]
As often, I had a Ruby script for that as well. It was simple but this one-liner is really a killer.
PS.:
According to Stackoverflow this is not working in Python 3. Instead you should write:
python -m http.server
Have not tested this however...
Written by Andreas Böhrnsen
Related protips
2 Responses
Cool
over 1 year ago
·
In Python3 version you can use custom port too (see python -m http.server -h
for more info).
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#