No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with
6 additions and
3 deletions
-
voicegardens/server.py
|
|
@ -3,7 +3,7 @@ |
|
|
|
import os.path |
|
|
|
from pathlib import Path |
|
|
|
|
|
|
|
from flask import Flask, render_template, request, send_from_directory |
|
|
|
from flask import Flask, render_template, request, send_from_directory, jsonify |
|
|
|
from flask_cors import CORS |
|
|
|
from werkzeug.utils import secure_filename |
|
|
|
|
|
|
@ -58,5 +58,8 @@ def uploaded_file(filename): |
|
|
|
def archive(): |
|
|
|
"""Serve the archive listing.""" |
|
|
|
listing = os.listdir(UPLOAD_DIRECTORY) |
|
|
|
files = filter(lambda f: f.endswith(".wav"), listing) |
|
|
|
return render_template("archive.html", files=files) |
|
|
|
filenames = filter(lambda f: f.endswith(".wav"), listing) |
|
|
|
return jsonify([ |
|
|
|
"{}{}".format(request.url_root, filename) |
|
|
|
for filename in filenames |
|
|
|
]) |
|
|
|