forked from opencarecc/graph-ryder-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
37 lines (32 loc) · 1.11 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import configparser
import os
from flask import Flask
from flask_restful import Api
from routes.user.user_routes import add_user_routes
from routes.comment.comment_routes import add_comment_routes
from routes.post.post_routes import add_post_routes
from routes.annotation.annotation_routes import add_annotation_routes
from routes.tag.tag_routes import add_tag_routes
from routes.tulipr.tulip_routes import add_tulip_routes
from routes.settings.settings_routes import add_settings_routes
from routes.general.general_routes import add_general_routes
config = configparser.ConfigParser()
config.read("config.ini")
if not os.path.exists(config['exporter']['tlp_path']):
os.makedirs(config['exporter']['tlp_path'])
app = Flask(__name__)
api = Api(app)
add_user_routes(api)
add_post_routes(api)
add_comment_routes(api)
add_annotation_routes(api)
add_tag_routes(api)
add_tulip_routes(api)
add_settings_routes(api)
add_general_routes(api)
if __name__ == '__main__':
app.run(host=config['api']['host'],
port=int(config['api']['port']),
debug=config['api']['debug'],
threaded = True
)