Python simple HTTP web server with logging output
- Start up a simple HTTP server, serving the files in the current working directory
- Open your default browser
- Getting logging output in the console
local port="${1:-8000}";
sleep 1 && open "http://0.0.0.0:${port}/" &
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port";
Written by Nicholas Drone
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Command line
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#