[Python] Starting a simple Python fileserver with asyncio

Discussão em 'Python' iniciado por Stack, Julho 25, 2025.

  1. Stack

    Stack Membro Participativo

    Using python3, I can start a simple web server which serves files in the current directory with

    from functools import partial
    from http.server import SimpleHTTPRequestHandler
    from socketserver import TCPServer

    with TCPServer(("", 8080), partial(SimpleHTTPRequestHandler, directory=".")) as httpd:
    httpd.serve_forever()


    Is there a simple way to do this using asyncio?

    Continue reading...

Compartilhe esta Página