some frontend cleanup, backend bug fix (database volumd mount)

This commit is contained in:
2019-03-24 13:45:19 +01:00
parent bc4e8e2cf1
commit e363cc3fd6
11 changed files with 35 additions and 35 deletions

View File

@@ -35,9 +35,10 @@ app_index = {c: {} for c in CORPORA}
# when running vuejs via webpack
# CORS(app)
CORS(app, resources={r"/api/*": {
"origins": "*",
}})
# CORS(app, resources={r"/api/*": {
# "origins": "*",
# }})
CORS(app)
# for testing functions
@@ -58,18 +59,15 @@ def home(pathname):
return redirect(url_for("index"), code=302)
# @app.route("/api/words/<corpus>")
# def api_words(corpus):
@app.route("/api/words")
def api_words():
@app.route("/api/words/<corpus>")
def api_words(corpus):
return json.dumps({
"sorted_words": app_index["ssj"]["words"], # todo - make corpus as arg
"sorted_words": app_index[corpus]["words"], # todo - make corpus as arg
})
@app.route("/api/functors")
def api_functors():
# return array ([functor, len])
return json.dumps(app_index["ssj"]["functors"])
@app.route("/api/functors/<corpus>")
def api_functors(corpus):
return json.dumps(app_index[corpus]["functors"])
@app.route("/api/register", methods=["POST"])