Added api endpoint

This commit is contained in:
Emily 2018-05-23 22:59:21 +02:00
parent d7b576f575
commit 1617b60ea6
3 changed files with 16 additions and 4 deletions

2
handlers/update.py Normal file
View File

@ -0,0 +1,2 @@
def handle(request):
return "Unimplemented"

1
templates/api.html Normal file
View File

@ -0,0 +1 @@
Unimplemented

9
web.py
View File

@ -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"])