24 lines
468 B
Python
24 lines
468 B
Python
from fastapi import FastAPI
|
||
from fastapi.middleware.cors import CORSMiddleware
|
||
|
||
from api.easy_orc_api import app as easy_orc_api
|
||
|
||
from api.paddle_ocr_api import app as paddle_ocr_api
|
||
|
||
|
||
app = FastAPI()
|
||
|
||
|
||
'''
|
||
添加cros中间件,允许跨域请求
|
||
'''
|
||
app.add_middleware(
|
||
CORSMiddleware,
|
||
allow_origins=["*"],
|
||
allow_credentials=True,
|
||
allow_methods=["*"],
|
||
allow_headers=["*"],
|
||
)
|
||
|
||
|
||
app.include_router(paddle_ocr_api, prefix="/ocr", tags=["ocr识别"]) |