diff --git a/electron/config/bin.js b/electron/config/bin.js index 5b5e328..acc8b5e 100644 --- a/electron/config/bin.js +++ b/electron/config/bin.js @@ -129,7 +129,7 @@ module.exports = { directory: './python', cmd: 'python', args: ['./main.py', '--port=7074'], - //stdio: ['ignore', 'ignore', 'ignore'], + stdio: 'ignore', }, }, }; \ No newline at end of file diff --git a/python/main.py b/python/main.py index a3256c4..2fc57d7 100644 --- a/python/main.py +++ b/python/main.py @@ -1,4 +1,8 @@ import argparse +import asyncio +from hypercorn.config import Config +from hypercorn.asyncio import serve + import uvicorn from fastapi import FastAPI @@ -30,4 +34,13 @@ async def info(): } if __name__ == "__main__": - uvicorn.run(app, host="127.0.0.1", port=args.port) \ No newline at end of file + uvicorn.run(app, host="127.0.0.1", port=args.port) + # Handler = http.server.SimpleHTTPRequestHandler + # with socketserver.TCPServer(("127.0.0.1", args.port), Handler) as httpd: + # print("Serving at port", args.port) + # httpd.serve_forever() + # config = Config() + # config.bind = ["127.0.0.1:" + str(args.port)] # As an example configuration setting + # asyncio.run(serve(app, config)) + +print("Serving at port", args.port) \ No newline at end of file