-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (29 loc) · 898 Bytes
/
main.py
File metadata and controls
39 lines (29 loc) · 898 Bytes
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 flask import Flask
# from api.config import config
from api.config.app_settings import create_app, Config
from api.controller.passport_verification_controller import passport_controller
def main():
# Custom error handling
error_handlers = []
# Blueprints
blueprints = [passport_controller]
# Load configuration
config = Config()
app = create_app(
Flask(__name__),
config,
blueprints=blueprints,
error_handlers=error_handlers
)
try:
options = {
"host": config.getConfig()["server"]["ip"],
"port": config.getConfig()["server"]["port"],
"debug": config.getConfig()["server"]["debug"]
}
app.run(**options)
except KeyError as e:
print(f"Configuration error: Missing {e} in the configuration.")
exit(1)
if __name__ == '__main__':
main()