14 lines
448 B
Python
14 lines
448 B
Python
|
from http.server import ThreadingHTTPServer
|
||
|
|
||
|
from classes.handler import ImageHandler
|
||
|
|
||
|
class ImageServer:
|
||
|
def __init__(self, source, fallback, port=8090, ip="0.0.0.0"):
|
||
|
class Handler(ImageHandler):
|
||
|
def __init__(self, *args, **kwargs):
|
||
|
super().__init__(source, fallback, *args, **kwargs)
|
||
|
|
||
|
self.server = ThreadingHTTPServer((ip, port), Handler)
|
||
|
|
||
|
def start(self):
|
||
|
self.server.serve_forever()
|