feat: handle statics
This commit is contained in:
parent
934cfba919
commit
cbe2d5059e
1 changed files with 10 additions and 5 deletions
|
@ -1,9 +1,9 @@
|
||||||
|
from io import BytesIO
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
from PIL import Image, ImageDraw, ImageFont
|
from PIL import Image, ImageDraw, ImageFont
|
||||||
from flask import Flask, request, make_response
|
from flask import Flask, request, make_response, redirect
|
||||||
from flask_cors import CORS
|
from flask_cors import CORS
|
||||||
from io import BytesIO
|
|
||||||
|
|
||||||
DEVICE = "B9:26:5A:67:50:49"
|
DEVICE = "B9:26:5A:67:50:49"
|
||||||
|
|
||||||
|
@ -12,9 +12,14 @@ app.config["MAX_CONTENT_LENGTH"] = 40 * 1024 * 1024
|
||||||
CORS(app)
|
CORS(app)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/print", methods=["OPTIONS", "HEAD"])
|
@app.route("/")
|
||||||
def head_image():
|
def index():
|
||||||
return "", 200
|
return redirect("/index.html")
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/<path:static>")
|
||||||
|
def static_helper(static):
|
||||||
|
return app.send_static_file(static)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/print", methods=["POST"])
|
@app.route("/print", methods=["POST"])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue