I can't find any Python code for the equivalent of
python -m http.server port --bind addr --directory dir
I need a server class that processes at least GET requests. Most things I found were either an HTTP server with some special needs or something like that, where you need to code the response behaviour be yourself:
from http.server import BaseHTTPRequestHandler, HTTPServer
def run(server_class=HTTPServer, handler_class=BaseHTTPRequestHandler):
server_address = ('', 8000)
httpd = server_class(server_address, handler_class)
httpd.serve_forever()
run()
I need a default working skeleton of a Python HTTP server, where you can provide address, port and directory, and it would normally process GET requests.