@bearnjs/rest
    Preparing search index...

    Function createRouter

    • Creates a new Bearn router instance. This function allows you to set up a router with optional configurations.

      Parameters

      • Optionaloptions: RouterOptions

        Configuration options for the Bearn router.

      Returns Router

      A new configured Bearn router instance.

      import createRouter from '@bearnjs/rest';

      const router = createRouter();
      import createRouter from '@bearnjs/rest';

      const router = createRouter({
      prefix: '/admin',
      });
      import createRouter from '@bearnjs/rest';

      const router = createRouter({
      middlewares: [
      (req, res, next) => {
      console.log('Hello, world!');
      next();
      },
      ],
      });