How to use the @loopback/rest.RoutingTable function in @loopback/rest

To help you get started, we’ve selected a few @loopback/rest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback-next / benchmark / src / rest-routing / routing-table.ts View on Github external
return (log?: (...args: unknown[]) => void) => {
    log = log ?? (() => {});
    log('Creating %s, %d', name, count);
    let start = process.hrtime();

    const table = new RoutingTable(router);
    table.registerController(spec, TestController);
    router.list(); // Force sorting
    log('Created %s %s', name, process.hrtime(start));

    log('Starting %s %d', name, count);
    let found = 0,
      missed = 0;
    start = process.hrtime();
    for (let i = 0; i < count; i++) {
      let group = `group${i}`;
      if (i % 8 === 0) {
        // Make it not found
        group = 'groupX';
      }
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      const request: any = {