18 lines
328 B
Python
18 lines
328 B
Python
import http.server
|
|
import socketserver
|
|
import functools
|
|
|
|
port = 9903
|
|
db = "db"
|
|
|
|
Handler = functools.partial(
|
|
http.server.SimpleHTTPRequestHandler,
|
|
directory=db
|
|
)
|
|
|
|
with socketserver.TCPServer(("", port), Handler) as httpd:
|
|
try:
|
|
httpd.serve_forever()
|
|
except KeyboardInterrupt:
|
|
httpd.server_close()
|