mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-06-12 14:01:03 +08:00
fastapi
This commit is contained in:
@@ -125,7 +125,7 @@ module.exports = {
|
||||
cmd: 'npm',
|
||||
args: ['-v'],
|
||||
},
|
||||
py: {
|
||||
python: {
|
||||
directory: './python',
|
||||
cmd: 'python',
|
||||
args: ['./main.py', '--port=7074'],
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"dev-frontend": "ee-bin dev --serve=frontend",
|
||||
"dev-electron": "ee-bin dev --serve=electron",
|
||||
"dev-go": "ee-bin dev --serve=go",
|
||||
"dev-py": "ee-bin exec --cmds=py",
|
||||
"dev-python": "ee-bin exec --cmds=python",
|
||||
"build-frontend": "ee-bin build --cmds=frontend && ee-bin move --flag=frontend_dist",
|
||||
"build-go-w": "ee-bin build --cmds=go_build_w",
|
||||
"build-go-m": "ee-bin build --cmds=go_build_m",
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import argparse
|
||||
import asyncio
|
||||
from hypercorn.config import Config
|
||||
from hypercorn.asyncio import serve
|
||||
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
|
||||
@@ -35,12 +31,6 @@ async def info():
|
||||
|
||||
if __name__ == "__main__":
|
||||
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))
|
||||
|
||||
# 控制台默认关闭输出信息,如果想要查看控制台输出,请单独启动服务 npm run dev-python
|
||||
print("Serving at port", args.port)
|
||||
Reference in New Issue
Block a user