Start listening to http incoming requests
server host address
server port
Optional
callback: ((mode?: string) => void)callback a function to run after starting to listen
Optional
mode: stringLoads a specified Axon plugin using the plugin loader.
The plugin to be loaded. It should be an instance of AxonPlugin.
loads created routes
instance of Router which routes set with it.
unload routes based on entered parameters
// this one unloads a route with path `/api/v1/user`.
core.unloadRoute({
route: '/api/v1/user'
});
// this one unloads all routes with method `GET`
core.unloadRoute({
method: 'GET'
});
const userRouter = Router();
// this one unloads all routes of userRouter.
core.unloadRoute({
router: userRouter
});
// this one unloads a route with path `/api/v1/user`, all routes with method `GET` and all routes of userRouter.
core.unloadRoute({
route: '/api/v1/user',
method: "GET",
router: userRouter
})
You can set one or many middlewares in global scope with this method.