12345678910111213141516171819202122232425 |
- from pathlib import Path
- import yaml
- __all__ = [
- 'mongo_conf',
- 'headers',
- 'node_module_path'
- ]
- _base_path = Path(__file__).parent
- _yaml_conf = (_base_path / 'conf.yaml').resolve()
- _yaml_constants = (_base_path / 'constants.yaml').resolve()
- _node_modules = (_base_path.parent / 'node_modules').resolve()
- with open(_yaml_conf, encoding="utf-8") as f:
- conf = yaml.safe_load(f)
- mongo_conf = conf['mongo']
- with open(_yaml_constants, encoding="utf-8") as fp:
- constants = yaml.safe_load(fp)
- headers: dict = constants['headers']
- node_module_path = _node_modules
|