chore: cleanups and docs

This commit is contained in:
foosinn 2024-03-30 14:33:07 +01:00
parent 5a9f05ccc9
commit a49ebfb76d
2 changed files with 8 additions and 0 deletions

View file

@ -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 ## Credits
Heavily based on [SFZ-aalen][1] Heavily based on [SFZ-aalen][1]

View file

@ -8,6 +8,7 @@ from flask_cors import CORS
DEVICE = "B9:26:5A:67:50:49" DEVICE = "B9:26:5A:67:50:49"
app = Flask(__name__) app = Flask(__name__)
app.config["MAX_CONTENT_LENGTH"] = 40 * 1024 * 1024 app.config["MAX_CONTENT_LENGTH"] = 40 * 1024 * 1024
app.config["UPLOAD_FOLDER"] = "uploads" app.config["UPLOAD_FOLDER"] = "uploads"
@ -38,6 +39,7 @@ def handle_image():
print_image = PrintImage(img) print_image = PrintImage(img)
print_image.print() print_image.print()
except Exception as e: except Exception as e:
print(e)
return f"Error printing image: {e}", 500 return f"Error printing image: {e}", 500
return "ok", 200 return "ok", 200