Spaces:
Sleeping
Sleeping
Download app.py from polats/test-space: direct link, hf CLI and curl.
- Browser
- Download file 525 Bytes
-
https://huggingface.co/spaces/polats/test-space/resolve/main/app.py
- Command line
-
hf download hf://spaces/polats/test-space/app.py
-
curl -L -o app.py https://huggingface.co/spaces/polats/test-space/resolve/main/app.py
525 Bytes
| import http.server | |
| import socketserver | |
| PORT = 7860 | |
| class Handler(http.server.BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| body = b"Hello from the test space!" | |
| self.send_response(200) | |
| self.send_header("Content-Type", "text/plain") | |
| self.send_header("Content-Length", str(len(body))) | |
| self.end_headers() | |
| self.wfile.write(body) | |
| def log_message(self, format, *args): | |
| pass | |
| with socketserver.TCPServer(("0.0.0.0", PORT), Handler) as httpd: | |
| httpd.serve_forever() |