forked from byceps/byceps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserve.py
More file actions
28 lines (22 loc) · 731 Bytes
/
serve.py
File metadata and controls
28 lines (22 loc) · 731 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
"""
Create and initialize the admin or site application, based on the
environment.
:Copyright: 2014-2023 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import os
from byceps.application import create_admin_app, create_api_app, create_site_app
from byceps.config import ConfigurationError
from byceps.util.sentry import configure_sentry_from_env
configure_sentry_from_env()
match os.environ.get('APP_MODE'):
case 'admin':
app = create_admin_app()
case 'api':
app = create_api_app()
case 'site':
app = create_site_app()
case _:
raise ConfigurationError(
'Unknown or no app mode configured for configuration key "APP_MODE".'
)