Caviar block for roe
$ npm i @caviar/roe-block
In caviar.config.js
module.exports = {
server (appInfo, config) {
// change config
return config
},
router (app, apply) {
const {router} = app
router.get('/foo', controller)
apply(app)
}
}
See [Caviar Blocks]
Triggered after roe config is generated and before using.
Callback parameters:
- serverConfig
object
the composed server configuration - caviarOptions ``
Triggered after router anchor has been applied.
Callback parameters:
- app
Koa
the roe application - caviarOptions
Triggered after all components of the roe application has been loaded, including:
- middlewares
- controllers
- services
- plugins
Callback parameters:
- app
- caviarOptions
Triggered when the server is listened to a port
Callback parameters:
- port
number
the port the server listening to - caviarOptions