Spaces:
Configuration error
Configuration error
| import http.server, socketserver | |
| class CORSRequestHandler(http.server.SimpleHTTPRequestHandler): | |
| def end_headers(self): | |
| self.send_header('Access-Control-Allow-Origin', '*') | |
| super().end_headers() | |
| # This matches the port Label Studio is looking for in your screenshot | |
| PORT = 8081 | |
| with socketserver.TCPServer(("", PORT), CORSRequestHandler) as httpd: | |
| print(f"🚀 Image server active at http://localhost:{PORT}") | |
| httpd.serve_forever() |