2019-12-16 15:19:26 +01:00
|
|
|
"""Flask server for the vocoder back-end."""
|
2019-12-11 11:20:35 +01:00
|
|
|
|
2019-12-16 15:19:26 +01:00
|
|
|
from flask import Flask, render_template, request
|
2019-12-11 11:20:35 +01:00
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/")
|
|
|
|
def root():
|
2019-12-16 15:19:26 +01:00
|
|
|
"""Serve the main homepage."""
|
2019-12-11 11:20:35 +01:00
|
|
|
return render_template("index.html")
|
2019-12-16 15:19:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
@app.route("/add-to-archive/", methods=["POST"])
|
|
|
|
def add_to_archive():
|
|
|
|
"""Accept audio recordings for archiving."""
|
|
|
|
# TODO: implement the saving of the files currently,
|
|
|
|
# I can't seem to get the file to send but the basic
|
|
|
|
# plumbing is in place
|
|
|
|
return ("faking it till we make it", 201)
|
2019-12-16 15:24:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
@app.route("/archive/")
|
|
|
|
def archive():
|
|
|
|
"""Serve the archive listing."""
|
|
|
|
return render_template("archive.html")
|