22 lines
400 B
Python
22 lines
400 B
Python
from fastapi import FastAPI
|
|
from settings import settings
|
|
from api import router
|
|
|
|
app = FastAPI(
|
|
title="Jtranslate",
|
|
description="Jtranslate翻译API",
|
|
version="1.0.0"
|
|
)
|
|
|
|
# 注册路由
|
|
app.include_router(router)
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
uvicorn.run(
|
|
"app:app",
|
|
host=settings.host,
|
|
port=settings.port,
|
|
reload=settings.debug
|
|
)
|