Add leptus_router:sort_dispatch/1 to order routes the way it matters in cowboy