diff --git a/amarillo/plugins/enhancer/enhancer.py b/amarillo/plugins/enhancer/enhancer.py index c07a8b0..349a76a 100644 --- a/amarillo/plugins/enhancer/enhancer.py +++ b/amarillo/plugins/enhancer/enhancer.py @@ -9,6 +9,7 @@ from amarillo.plugins.enhancer.configuration import configure_enhancer_services from amarillo.app.utils.container import container from amarillo.app.models.Carpool import Carpool from amarillo.app.utils.utils import agency_carpool_ids_from_filename +from amarillo.plugins.enhancer.services.export_router import export_router logging.config.fileConfig('logging.conf', disable_existing_loggers=False) logger = logging.getLogger("enhancer") @@ -70,6 +71,8 @@ def run_enhancer(): logger.info("Goodbye Enhancer") def setup(app): + app.include_router(export_router) + thread = Thread(target=run_enhancer) thread.start() diff --git a/amarillo/plugins/enhancer/services/export_router.py b/amarillo/plugins/enhancer/services/export_router.py new file mode 100644 index 0000000..582b64d --- /dev/null +++ b/amarillo/plugins/enhancer/services/export_router.py @@ -0,0 +1,12 @@ +from fastapi import APIRouter, Depends +from amarillo.app.routers.agencyconf import verify_admin_api_key +from amarillo.plugins.enhancer.services.gtfs_generator import generate_gtfs + +export_router = APIRouter( + prefix="", + tags=["export"] +) + +@export_router.post("/export") +async def post_agency_conf(admin_api_key: str = Depends(verify_admin_api_key)): + generate_gtfs() \ No newline at end of file