start tiny web server with current folder as http root path

httpd.py

1
2
3
4
5
6
7
8
9
10
from http.server import HTTPServer, SimpleHTTPRequestHandler
 
handler = SimpleHTTPRequestHandler
handler.extensions_map.update({
	".js": "application/javascript",
})
 
server_address = ("", 8008)
server = HTTPServer(server_address, handler)
server.serve_forever()

how to run

1
python3 ./httpd.py