blob: bd917bb99408c1c96de955268060482f7f919801 (
plain)
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
38
39
40
41
42
43
|
# Copyright (c) Authors of Clover
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
from flask import Flask
from api.collector import collector
from views.visibility import visibility
from api.visibility import visibility_api
from api.snort import snort
from api.halyard import halyard
from api.nginx import nginx
from api.jmeter import jmeter
from api.file_upload import file_upload
import logging
logging.basicConfig(filename='flask.log', level=logging.DEBUG)
application = Flask(__name__)
try:
# Register blueprints
application.register_blueprint(collector)
application.register_blueprint(visibility)
application.register_blueprint(visibility_api)
application.register_blueprint(snort)
application.register_blueprint(halyard)
application.register_blueprint(nginx)
application.register_blueprint(jmeter)
application.register_blueprint(file_upload)
except Exception as e:
logging.debug(e)
@application.route("/test")
def test():
return "<h1 style='color:blue'>clover-controller up</h1>"
if __name__ == "__main__":
application.run(host='0.0.0.0')
|