Added api endpoint
This commit is contained in:
parent
d7b576f575
commit
1617b60ea6
2
handlers/update.py
Normal file
2
handlers/update.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
def handle(request):
|
||||||
|
return "Unimplemented"
|
1
templates/api.html
Normal file
1
templates/api.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Unimplemented
|
9
web.py
9
web.py
|
@ -2,6 +2,7 @@ import json
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
import MySQLdb.cursors
|
||||||
from flask import Flask, make_response, request, render_template, jsonify
|
from flask import Flask, make_response, request, render_template, jsonify
|
||||||
|
from handlers import update
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -17,5 +18,13 @@ def home_index():
|
||||||
def download_index():
|
def download_index():
|
||||||
return render_template("download.html")
|
return render_template("download.html")
|
||||||
|
|
||||||
|
@app.route("/api")
|
||||||
|
def api_index():
|
||||||
|
return render_template("api.html")
|
||||||
|
|
||||||
|
@app.route("/api/getUpdate", methods=["GET", "POST"])
|
||||||
|
def api_update():
|
||||||
|
return update.handle(request)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(**config["web"])
|
app.run(**config["web"])
|
Loading…
Reference in New Issue
Block a user