Start HTTP server using Python's built-in http.server.
(port: int, directory: Path)
| 111 | |
| 112 | # Start an HTTP server on the dynamic port |
| 113 | def start_http_server(port: int, directory: Path) -> multiprocessing.Process: |
| 114 | """Start HTTP server using Python's built-in http.server.""" |
| 115 | server_process = multiprocessing.Process( |
| 116 | target=_run_http_server, |
| 117 | args=(port, str(directory)), |
| 118 | daemon=True, |
| 119 | ) |
| 120 | server_process.start() |
| 121 | return server_process |
| 122 | |
| 123 | |
| 124 | async def main() -> None: |