dev
This commit is contained in:
+8
-10
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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) {
|
||||
// 将二进制字符串转换为字符数组
|
||||
|
||||
Reference in New Issue
Block a user