Add the bones of an Email Notification service

This commit is contained in:
Campbell Alden 2026-07-30 23:48:10 +09:00
parent a7fdd6cbd0
commit 24bb9dae30
8 changed files with 138 additions and 8 deletions

View file

@ -5,7 +5,7 @@ from flask import Flask
import argparse
import logging
from src.config import parse_config, DEFAULT_CONFIG, Config
from src.config import parse_config, Config
logger = logging.getLogger(__name__)
@ -23,9 +23,10 @@ def create_app(name: str, config: Config) -> Flask:
def main():
parser = argparse.ArgumentParser('Cereal', description='run the Cereal server')
parser.add_argument('--config', '-c', help='The path to the configuration file, expects JSON')
parser.add_argument('--config', '-c', help='The path to the configuration file, expects JSON', required=True)
args = parser.parse_args()
config = parse_config(args.config) if args.config else DEFAULT_CONFIG
config = parse_config(args.config)
app = create_app('Cereal', config)
logger.info(str(config))
serve(app, host='0.0.0.0' if config.host is None else config.host, port=config.port)