forked from kristjan/cjvt-valency
some frontend cleanup, backend bug fix (database volumd mount)
This commit is contained in:
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user