MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / create_app

Function create_app

keepercommander/service/app.py:21–46  ·  view source on GitHub ↗

Create and configure the Keeper Commander Service.

()

Source from the content-addressed store, hash-verified

19
20
21def create_app():
22 """Create and configure the Keeper Commander Service."""
23 logger.debug("Initializing Keeper Commander Service")
24
25 log = logging.getLogger('werkzeug')
26 log.setLevel(logging.ERROR)
27 log.addFilter(SSLHandshakeFilter())
28
29 app = Flask(__name__)
30
31 if is_behind_proxy():
32 app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)
33
34 try:
35 logger.debug("Configuring rate limiter")
36 limiter.init_app(app)
37
38 logger.debug("Initializing API routes")
39 init_routes(app)
40
41 print("Keeper Commander Service initialization complete")
42 return app
43
44 except Exception as e:
45 logger.error(f"Failed to initialize Keeper Commander Service: {str(e)}")
46 raise

Callers 2

service_app.pyFile · 0.85
start_serviceMethod · 0.85

Calls 5

is_behind_proxyFunction · 0.85
init_routesFunction · 0.85
SSLHandshakeFilterClass · 0.50
debugMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected