]> git.somenet.org - pub/jan/aic18.git/blob - service-analysis/sentiment_analysis.py
Add online @ info + little polishing.
[pub/jan/aic18.git] / service-analysis / sentiment_analysis.py
1 # -*- coding: utf-8 -*-
2 import json
3 import indicoio
4 import os
5
6 from analysis import Analysis
7 from offline_analysis import Offline_Analysis
8 from health_check import Health_Check
9
10 from flask import Flask
11 from flask_restful import Api
12
13 app = Flask(__name__)
14 api = Api(app)
15
16 indicoio.config.api_key = os.environ['INDICO_API_KEY']
17
18 api.add_resource(Analysis, '/')
19 api.add_resource(Offline_Analysis, '/offline_analysis')
20 api.add_resource(Health_Check, '/health')
21
22 if __name__ == '__main__':
23         app.run(host="0.0.0.0", port=8081, debug=False)