Files
ocr_demo/application.py
2025-09-28 13:37:21 +08:00

24 lines
468 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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识别"])