Commit 9545139e authored by Romain Loth's avatar Romain Loth

route was renamed in tina to comexAPI so coherence + service is better on...

route was renamed in tina to comexAPI so coherence + service is better on 0.0.0.0 for nginx reverse proxy
parent 8147d014
......@@ -13,18 +13,19 @@ import simplejson as json
app = Flask(__name__)
@app.route("/getJSON")
# @app.route("/getJSON") # route renamed
@app.route("/comexAPI")
def main():
db=SQLite('../community.db')
if request.args.has_key("query"):
filteredquery = request.args['query']
scholars = db.getScholarsList("filter",filteredquery)
db.extract(scholars)
else:
unique_id = request.args['unique_id']
scholars = db.getScholarsList("unique_id",unique_id)
if scholars and len(scholars):
db.extract(scholars)
# < / Data Extraction > #
......@@ -32,7 +33,7 @@ def main():
return json.dumps(graphArray)
if __name__ == "__main__":
app.run(port=8080)
app.run(host="0.0.0.0", port=8484)
### A possible connection of comex helper app (comex_install)
Here is the simplest possible nginx configuration to make comex_install answer http requests for /comexAPI (previously known as "/getJSON")
```
# for comex_install helper app
location /comexAPI {
proxy_pass http://0.0.0.0:8484;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
```
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