File size: 333 Bytes
8e02cc8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import http.server
import socketserver
import os
PORT = int(os.environ.get("PORT", 7860))
os.chdir(os.path.dirname(os.path.abspath(__file__)))
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("0.0.0.0", PORT), Handler) as httpd:
print(f"Serving at http://0.0.0.0:{PORT}")
httpd.serve_forever()
|