-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
39 lines (30 loc) · 1.01 KB
/
Copy pathapp.py
File metadata and controls
39 lines (30 loc) · 1.01 KB
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
import logging
from typing import Dict
from chalice import Chalice
# Application version
APP_VERSION = '2.1.3'
def get_version_info() -> Dict[str, str]:
"""Get version information"""
return {'version': APP_VERSION}
# Set application name and version
app = Chalice(app_name='ec2-quicklook')
app.version = get_version_info()
# Enhanced logging configuration
app.log.setLevel(logging.INFO)
# Add timestamp and log level to format
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
logger = app.log
# set Global CORS
# app.api.cors = True
# Register blueprints
from chalicelib.swagger import bp as swagger_bp
from chalicelib.product import bp as product_bp
from chalicelib.webui import bp as webui_bp
app.register_blueprint(swagger_bp, name_prefix='swagger')
app.register_blueprint(product_bp, name_prefix='product')
app.register_blueprint(webui_bp, name_prefix='webui')
# Log application startup
logger.info("EC2 Quicklook application initialized")