This commit is contained in:
2025-03-31 12:58:37 +08:00
parent 62265f66a1
commit d7e20b2cca
2 changed files with 12 additions and 10 deletions
+8 -10
View File
@@ -5,21 +5,19 @@ from multiprocessing import freeze_support
from api.core import Exceptions,Middleware,Gzip
import uvicorn
application = FastAPI(docs_url=None, redoc_url=None)
application.add_exception_handler(Exception, Exceptions.all_exception_handler)
Middleware.register_cors(application)
Gzip.register_gzip_response(application)
application.include_router(api_router)
if __name__ == '__main__':
freeze_support()
def on_startup():
return print("Application starting...")
application = FastAPI(docs_url=None, redoc_url=None)
application.add_exception_handler(Exception, Exceptions.all_exception_handler)
Middleware.register_cors(application)
Gzip.register_gzip_response(application)
application.include_router(api_router)
uvicorn.run(app = application, host='127.0.0.1', port=config.PORT)
uvicorn.run(app = "main:application", host='127.0.0.1', port=config.PORT, workers=config.WORKERS,reload=False)
+4
View File
@@ -27,6 +27,10 @@ if (import.meta.env.MODE == 'web' || import.meta.env.MODE == 'show') {
baseURL = 'https://api.dnftools.com/'
}
if(import.meta.env.MODE == 'test') {
baseURL = 'https://testapi.dnftools.com/'
}
// 解压
function unzip(key: string) {
// 将二进制字符串转换为字符数组