Spaces:
Sleeping
Sleeping
File size: 859 Bytes
954be92 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
#!/usr/bin/env python
"""
启动脚本
运行汇率换算服务
"""
import uvicorn
from app.config import get_settings
def main():
"""主函数"""
settings = get_settings()
print("=" * 50)
print("🚀 启动汇率换算服务")
print("=" * 50)
print(f"📍 服务地址: http://localhost:{settings.SERVER_PORT}")
print(f"📊 API 文档: http://localhost:{settings.SERVER_PORT}/docs")
print(f"💱 基准货币: {settings.BASE_CURRENCY}")
print(f"🔑 API Keys: {len(settings.API_KEYS)} 个")
print(f"⏰ 缓存更新间隔: {settings.CACHE_UPDATE_INTERVAL} 秒")
print("=" * 50)
uvicorn.run(
"app.main:app",
host="0.0.0.0",
port=settings.SERVER_PORT,
reload=True, # 开发模式下自动重载
log_level="info"
)
if __name__ == "__main__":
main()
|