Difference between revisions of "Python3: http.server"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with " import http.server import socketserver PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd:...") |
Onnowpurbo (talk | contribs) (→Run) |
||
Line 16: | Line 16: | ||
==Run== | ==Run== | ||
− | + | python3 -m http.server 8000 | |
− | + | python3 -m http.server 8000 --bind 127.0.0.1 | |
− | + | python3 -m http.server --directory /tmp/ | |
− | |||
==Referensi== | ==Referensi== |
Latest revision as of 10:26, 24 November 2018
import http.server import socketserver PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd: print("serving at port", PORT) httpd.serve_forever()
Run
python3 -m http.server 8000 python3 -m http.server 8000 --bind 127.0.0.1 python3 -m http.server --directory /tmp/