-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkeec.py
39 lines (31 loc) · 967 Bytes
/
keec.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
38
39
from gevent import monkey
monkey.patch_all()
from flask import Flask
from flask_compress import Compress
from core.commands import command_manager
import settings
from core.api import rest_api
#Flask App
app = Flask(__name__, static_url_path='/kbeat/assets')
Compress(app)
app.config.from_object(settings)
#KEEC Rest api
app.register_blueprint(rest_api, url_prefix='/kbeat/api')
#Commands
manager = command_manager(app)
@app.after_request
def adding_header_content(head):
head.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
head.headers["Pragma"] = "no-cache"
head.headers["Expires"] = "0"
head.headers['Cache-Control'] = 'public, max-age=0'
return head
@app.route('/kbeat/')
@app.route('/kbeat/<path:path>')
def index(path=''):
return app.send_static_file('views/index.html')
@app.route('/kbeat/favicon.ico')
def favicon():
return app.send_static_file('favicon.ico')
if __name__ == "__main__":
manager.run()