Download server.py from lhoestq/hf-jobs-compose-server-script: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/lhoestq/hf-jobs-compose-server-script/resolve/main/server.py
- Command line
-
hf download hf://lhoestq/hf-jobs-compose-server-script/server.py
-
curl -L -o server.py https://huggingface.co/lhoestq/hf-jobs-compose-server-script/resolve/main/server.py
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() |