Page Contents

Home > @loopback/rest > compareRoute

compareRoute() function

Compare two routes by verb/path for sorting

Signature:

export declare function compareRoute(route1: Pick<RouteEntry, 'verb' | 'path'>, route2: Pick<RouteEntry, 'verb' | 'path'>): number;

Parameters

Parameter Type Description
route1 Pick<[RouteEntry](/doc/en/lb4/apidocs.rest.routeentry.html), 'verb' \| 'path'> First route entry
route2 Pick<[RouteEntry](/doc/en/lb4/apidocs.rest.routeentry.html), 'verb' \| 'path'> Second route entry

Returns:

number