Home > kibana-plugin-core-server > HttpServiceSetup > createRouter
Provides ability to declare a handler function for a particular path and HTTP request method.
Signature:
createRouter: () => IRouter;
Each route can have only one handler function, which is executed when the route is matched. See the IRouter documentation for more information.
const router = createRouter();
// handler is called when '/path' resource is requested with `GET` method
router.get({ path: '/path', validate: false }, (context, req, res) => res.ok({ content: 'ok' }));