• # Exemple pas comparable

    Posté par (site web personnel) . En réponse au lien Difficile de recommander Python en production . Évalué à 8.

    Python a aussi un serveur HTTP dans la librairie standard :

    from http.server import BaseHTTPRequestHandler, HTTPServer
    class Handler(BaseHTTPRequestHandler):
     def do_GET(self):
     self.send_response(200)
     self.send_header('Content-type', 'text/plain')
     self.end_headers()
     self.wfile.write(b'hello world')
    if __name__ == '__main__':
     server = HTTPServer(('localhost', 8000), Handler)
     print('Server running on http://localhost:8000/')
     server.serve_forever()

    Pas besoin d'installer FastAPI pour ça. L'image `python:3.13-alpine" fait 45Mo (18Mo compressée), pas 164Mo.

    https://link-society.com - https://kubirds.com - https://github.com/link-society/flowg