from starlette.routing import Route

from starlette_proxy_router.compile import RouteCompilier
from starlette_proxy_router.parser import EndpointArgs


def create_routes(endpoints_args: list[EndpointArgs]) -> list[Route]:
    compilier = RouteCompilier()
    routes = []
    for args in endpoints_args:
        route = compilier.compile_route(args)
        routes.append(route)
    return routes
