update: 将app启动位置至根目录下
This commit is contained in:
1 parent
88bcfd03a6
commit
0593bf0482
3 files changed
+27
-35
No files matched your search
@@ -1,9 +1,24 @@
|
||||
import os
|
||||
from app import app, Config
|
||||
import uvicorn
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
script_path = os.path.join(os.path.dirname(__file__), 'app', 'main.py')
|
||||
|
||||
# 使用exec函数执行脚本
|
||||
with open(script_path, 'r') as file:
|
||||
exec(file.read())
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, host=Config.UVICORN.HOST, port=Config.UVICORN.PORT)
|
||||
# _ooOoo_ #
|
||||
# o8888888o #
|
||||
# 88" . "88 #
|
||||
# (| -_- |) #
|
||||
# O\ = /O #
|
||||
# ____/`---'\____ #
|
||||
# . ' \\| |// `. #
|
||||
# / \\||| : |||// \ #
|
||||
# / _||||| -:- |||||- \ #
|
||||
# | | \\\ - /// | | #
|
||||
# \ .-\__ `-` ___/-. / #
|
||||
# ___`. .' /--.--\ `. . __ #
|
||||
# ."" '< `.___\_<|>_/___.' >'"". #
|
||||
# | | : `- \`.;`\ _ /`;.`/ - ` : | | #
|
||||
# \ \ `-. \_ __\ /__ _/ .-` / / #
|
||||
# ======`-.____`-.___\_____/___.-`____.-'====== #
|
||||
# `=---=' #
|
||||
# ............................................. #
|
||||
# 佛祖保佑 永无BUG #
|
||||
Reference in new issue
Block a user