-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
38 lines (26 loc) · 806 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import flask
import json
import base64
import engine.renderpreview
import engine.render
app = flask.Flask(__name__)
@app.route("/")
def hello_world():
return flask.redirect("static/index.html")
@app.route("/api/renderpreview")
def renderpreview():
return engine.renderpreview.renderpreview(
json.loads(base64.b64decode(flask.request.args.get("state"))),
flask.request.args.get("mobile") == "true",
)
@app.route("/api/render")
def queuerender():
return engine.render.queue_render(
json.loads(base64.b64decode(flask.request.args.get("state")))
)
@app.route("/api/preview")
def preview():
return engine.render.preview_render(int(flask.request.args.get("id")))
@app.route("/api/recent")
def recentrenders():
return engine.render.recent_renders()