-
Notifications
You must be signed in to change notification settings - Fork 12
/
application.py
32 lines (22 loc) · 963 Bytes
/
application.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
import os
from apig_wsgi import make_lambda_handler
from dotenv import load_dotenv
from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from app import create_app
load_dotenv()
application = Flask("app")
application.wsgi_app = ProxyFix(application.wsgi_app) # type: ignore
create_app(application)
apig_wsgi_handler = make_lambda_handler(application, binary_support=True)
if os.environ.get("USE_LOCAL_JINJA_TEMPLATES") == "True":
print("") # noqa: T201
print("========================================================") # noqa: T201
print("") # noqa: T201
print("WARNING: USING LOCAL JINJA from /jinja_templates FOLDER!") # noqa: T201
print(".env USE_LOCAL_JINJA_TEMPLATES=True") # noqa: T201
print("") # noqa: T201
print("========================================================") # noqa: T201
print("") # noqa: T201
def handler(event, context):
return apig_wsgi_handler(event, context)