diff options
author | Joris | 2024-06-02 14:38:13 +0200 |
---|---|---|
committer | Joris | 2024-06-02 14:38:22 +0200 |
commit | 1019ea1ed341e3a7769c046aa0be5764789360b6 (patch) | |
tree | 1a0d8a4f00cff252d661c42fc23ed4c19795da6f /src/main-old.py | |
parent | e8da9790dc6d55cd2e8883322cdf9a7bf5b4f5b7 (diff) |
Migrate to Rust and Hyper
With sanic, downloading a file locally is around ten times slower than
with Rust and hyper.
Maybe `pypy` could have helped, but I didn’t succeed to set it up
quickly with the dependencies.
Diffstat (limited to 'src/main-old.py')
-rw-r--r-- | src/main-old.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/main-old.py b/src/main-old.py deleted file mode 100644 index 42d7c8c..0000000 --- a/src/main-old.py +++ /dev/null @@ -1,33 +0,0 @@ -# import http.server -# import logging -# import os -# import sys - -# import server - -# logger = logging.getLogger(__name__) -# hostName = os.environ['HOST'] -# serverPort = int(os.environ['PORT']) - -# if __name__ == '__main__': -# logging.basicConfig(stream=sys.stdout, level=logging.INFO) -# webServer = http.server.HTTPServer((hostName, serverPort), server.MyServer) -# logger.info('Server started at http://%s:%s.' % (hostName, serverPort)) - -# try: -# webServer.serve_forever() -# except KeyboardInterrupt: -# pass - -# webServer.server_close() -# conn.close() -# logger.info('Server stopped.') - -from sanic import Sanic -from sanic.response import text - -app = Sanic("MyHelloWorldApp") - -@app.get("/") -async def hello_world(request): - return text("Hello, world.") |