File tree 4 files changed +2
-38
lines changed
4 files changed +2
-38
lines changed Original file line number Diff line number Diff line change 1
1
/test /
2
2
/.venv /
3
3
uploads /*
4
+ ! . /uploads /default.jpg
4
5
log /*
5
6
.venv
6
7
.idea
Original file line number Diff line number Diff line change 1
1
import uvicorn
2
2
from fastapi import FastAPI
3
3
from fastapi .middleware .cors import CORSMiddleware
4
- from uvicorn .config import LOGGING_CONFIG
5
4
6
5
from api .adminapi import adminapp
7
6
from api .postapi import postapp
8
7
from api .userapi import userapp
9
8
from config import Config
10
- from config .log_config import my_LOGGING_CONFIG
11
9
12
10
app = FastAPI (
13
11
title = 'api docs' ,
27
25
app .include_router (adminapp , prefix = '/api/admin' , tags = ['管理员' ])
28
26
app .include_router (postapp , prefix = '/api/post' , tags = ['post' ])
29
27
30
- log_cfg = LOGGING_CONFIG if Config ['Development' ] else my_LOGGING_CONFIG # Development 输出到终端
31
28
32
29
if __name__ == '__main__' :
33
- print ('后台运行: nohup python3 app.py > ./log/ output.log 2>&1 &\n ' )
30
+ print ('后台运行: nohup python3 app.py > output.log 2>&1 &\n ' )
34
31
c = Config ["uvicorn" ]
35
32
uvicorn .run (app = 'app:app' ,
36
33
host = c ["host" ],
37
34
port = c ["port" ],
38
35
reload = Config ['Development' ],
39
36
workers = c ['workers' ],
40
- # log_config=log_cfg,
41
37
)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments