mirror of
https://github.com/sml2h3/ocr_api_server.git
synced 2025-05-04 05:29:50 +08:00
Update ocr_server.py
允许特定网站的跨域
This commit is contained in:
parent
70322957e4
commit
7ead30c81b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user