mirror of
https://github.com/yiGmMk/wxocr.git
synced 2026-04-22 16:17:09 +08:00
refactor: doc
This commit is contained in:
@@ -123,6 +123,12 @@ if __name__ == "__main__":
|
||||
# result = ocr_recognize(image_url="https://example.com/image.png")
|
||||
```
|
||||
|
||||
### test
|
||||
|
||||
```bash
|
||||
bash test.sh
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `main.py`: The Flask API service that handles OCR requests
|
||||
|
||||
@@ -69,6 +69,18 @@ def index():
|
||||
return render_template("index.html")
|
||||
|
||||
|
||||
# Handle unsupported methods for /ocr route
|
||||
@app.route("/ocr", methods=["GET", "PUT", "DELETE", "PATCH"])
|
||||
def unsupported_method():
|
||||
return jsonify({"error": "Method not allowed"}), 405
|
||||
|
||||
|
||||
# Handle non-existent paths
|
||||
@app.errorhandler(404)
|
||||
def not_found(e):
|
||||
return jsonify({"error": "Resource not found"}), 404
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 确保templates目录存在
|
||||
templates_dir = os.path.join(
|
||||
|
||||
Reference in New Issue
Block a user