Commit ed8ea3da authored by Romain Loth's avatar Romain Loth

rename graph API /api/graph instead of /api

parent 5b84755c
......@@ -114,28 +114,28 @@ def services():
return redirect(url_for('login', _external=True))
# /services/api/
@app.route(config['PREFIX'] + config['API_ROUTE'] + '/')
def api_main():
# /services/api/graph
@app.route(config['PREFIX'] + config['API_ROUTE'] + '/graph')
def graph_api():
"""
API to provide json extracts of the DB to tinaweb
(originally @ moma/legacy_php_comex/tree/master/comex_install)
(original author S. Castillo)
"""
db=MySQL(config['SQL_HOST'])
if 'qtype' in request.args:
scholars = db.getScholarsList(request.args['qtype'], restparse(request.query_string.decode()))
else:
raise TypeError("API query is missing qtype (should be 'filters' or 'uid')")
graphdb=MySQL(config['SQL_HOST'])
scholars = graphdb.getScholarsList(request.args['qtype'], restparse(request.query_string.decode()))
if scholars and len(scholars):
# Data Extraction
graphdb.extract(scholars)
if scholars and len(scholars):
# Data Extraction
db.extract(scholars)
graphArray = graphdb.buildJSON_sansfa2(graphdb.Graph)
return dumps(graphArray)
graphArray = db.buildJSON_sansfa2(db.Graph)
return dumps(graphArray)
else:
raise TypeError("graph API query is missing qtype (should be 'filters' or 'uid')")
# /services/user/
......
......@@ -19,8 +19,8 @@ var iwantograph = "";
var bridge={};
external="";
//external="http://tina.iscpif.fr/explorerjs/";//Just if you want to use the server-apps from tina.server
bridge["forFilteredQuery"] = "services/api" //external+"php/bridgeClientServer_filter.php";
bridge["forNormalQuery"] = "services/api" //external+"php/bridgeClientServer.php";
bridge["forFilteredQuery"] = "services/api/graph" //external+"php/bridgeClientServer_filter.php";
bridge["forNormalQuery"] = "services/api/graph" //external+"php/bridgeClientServer.php";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment