diff --git a/README.md b/README.md index e6f4a03..6725b95 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ poetry run gunicorn -w 1 'phomeme:app' -b [::0] ``` +## Usage + + +Visit the awesome frontend on http://localhost:8000 or send via curl +using `curl -v -F image=@image.pdf localhost:5000/print`. + ## Credits Heavily based on [SFZ-aalen][1] diff --git a/phomeme/__init__.py b/phomeme/__init__.py index 4826562..205d642 100644 --- a/phomeme/__init__.py +++ b/phomeme/__init__.py @@ -8,6 +8,7 @@ from flask_cors import CORS DEVICE = "B9:26:5A:67:50:49" + app = Flask(__name__) app.config["MAX_CONTENT_LENGTH"] = 40 * 1024 * 1024 app.config["UPLOAD_FOLDER"] = "uploads" @@ -38,6 +39,7 @@ def handle_image(): print_image = PrintImage(img) print_image.print() except Exception as e: + print(e) return f"Error printing image: {e}", 500 return "ok", 200