diff --git a/notiframe/Server.py b/notiframe/Server.py new file mode 100644 index 0000000..b86ea15 --- /dev/null +++ b/notiframe/Server.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +from notiframe import Notiframe +import os +from flask import Flask, render_template, request, redirect, url_for, send_file + +app = Flask(__name__) + +mydir = os.path.dirname(os.path.abspath(__file__)) + +mgr = Notiframe.Manager() + +@app.route('//get_image', methods=['GET']) #when requesting this http endpoint, use eg. /2y7d8s9k/get_image with '2y7d8s9k' being the device id +def display(device_id): + img = mgr.get_image(device_id) + return send_file(img) + +if __name__ == '__main__': + app.run(debug=True, host='0.0.0.0') \ No newline at end of file