Update ocr_server.py

允许特定网站的跨域
This commit is contained in:
wenjiaran 2023-07-02 11:48:19 +08:00 committed by GitHub
parent 70322957e4
commit 7ead30c81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,10 @@ import json
import ddddocr
from flask import Flask, request
from flask_cors import CORS
app = Flask(__name__)
CORS(app, origins=["http://example.com"])
parser = argparse.ArgumentParser(description="使用ddddocr搭建的最简api服务")
parser.add_argument("-p", "--port", type=int, default=9898)