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
|
17
web.py
17
web.py
|
@ -2,20 +2,29 @@ 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__)
|
||||||
|
|
||||||
with open("config.json", "r") as f:
|
with open("config.json", "r") as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
@app.route("/home")
|
@app.route("/home")
|
||||||
def home_index():
|
def home_index():
|
||||||
return render_template("index.html")
|
return render_template("index.html")
|
||||||
|
|
||||||
@app.route("/download")
|
@app.route("/download")
|
||||||
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