You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
556 B
18 lines
556 B
#!/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('/<device_id>/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') |