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

17
web.py
View File

@ -2,20 +2,29 @@ import json
import MySQLdb
import MySQLdb.cursors
from flask import Flask, make_response, request, render_template, jsonify
from handlers import update
app = Flask(__name__)
with open("config.json", "r") as f:
config = json.load(f)
config = json.load(f)
@app.route("/")
@app.route("/home")
def home_index():
return render_template("index.html")
return render_template("index.html")
@app.route("/download")
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__":
app.run(**config["web"])
app.run(**config["web"])