[misc] Add behind_proxy and regroup config params
This commit is contained in:
parent
3025d8b05a
commit
754dbe6762
|
@ -24,10 +24,13 @@ from sys import argv
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'database_connection': 'sqlite:////tmp/kibicara.sqlite',
|
'database_connection': 'sqlite:////tmp/kibicara.sqlite',
|
||||||
|
'frontend_url': 'http://127.0.0.1:4200', # dev default
|
||||||
|
'behind_proxy': False,
|
||||||
|
# production params
|
||||||
'frontend_path': None,
|
'frontend_path': None,
|
||||||
'root_url': 'http://localhost:8000',
|
|
||||||
'frontend_url': 'http://127.0.0.1:4200',
|
|
||||||
'production': True,
|
'production': True,
|
||||||
|
# dev params
|
||||||
|
'root_url': 'http://localhost:8000',
|
||||||
'cors_allow_origin': 'http://127.0.0.1:4200',
|
'cors_allow_origin': 'http://127.0.0.1:4200',
|
||||||
}
|
}
|
||||||
""" Default configuration.
|
""" Default configuration.
|
||||||
|
|
|
@ -57,6 +57,7 @@ class Main:
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
server_config = Config()
|
server_config = Config()
|
||||||
server_config.accesslog = '-'
|
server_config.accesslog = '-'
|
||||||
|
server_config.behind_proxy = config['behind_proxy']
|
||||||
if config['production']:
|
if config['production']:
|
||||||
server_config.bind = ['0.0.0.0:8000', '[::]:8000']
|
server_config.bind = ['0.0.0.0:8000', '[::]:8000']
|
||||||
api = FastAPI()
|
api = FastAPI()
|
||||||
|
|
Loading…
Reference in a new issue