lhoestq's picture
lhoestq HF Staff
Upload server.py with huggingface_hub
7c5bbf7 verified
Raw
History Blame Contribute Delete
496 Bytes
from http.server import HTTPServer, BaseHTTPRequestHandler
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/hello':
self.send_response(200)
self.send_header('Content-Type', 'text/plain')
self.end_headers()
self.wfile.write(b'hello !')
else:
self.send_response(404)
self.end_headers()
def log_message(self, *a):
pass
HTTPServer(('', 8000), Handler).serve_forever()