Creates a new Bearn router instance. This function allows you to set up a router with optional configurations.
Optional
Configuration options for the Bearn router.
A new configured Bearn router instance.
import createRouter from '@bearnjs/rest';const router = createRouter(); Copy
import createRouter from '@bearnjs/rest';const router = createRouter();
import createRouter from '@bearnjs/rest';const router = createRouter({ prefix: '/admin',}); Copy
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(); }, ],}); Copy
import createRouter from '@bearnjs/rest';const router = createRouter({ middlewares: [ (req, res, next) => { console.log('Hello, world!'); next(); }, ],});
Creates a new Bearn router instance. This function allows you to set up a router with optional configurations.