4.0.2 • Published 5 years ago

@caviar/roe-block v4.0.2

Weekly downloads
100
License
MIT
Repository
github
Last release
5 years ago

Build Status Coverage

@caviar/roe-block

Caviar block for roe

Install

$ npm i @caviar/roe-block

Usage

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)
  }
}

Hooks

...builtInBlockHooks

See Caviar Blocks

serverConfig SyncHook

Triggered after roe config is generated and before using.

Callback parameters:

  • serverConfig object the composed server configuration
  • caviarOptions

routerLoaded SyncHook

Triggered after router anchor has been applied.

Callback parameters:

  • app Koa the roe application
  • caviarOptions

loaded SyncHook

Triggered after all components of the roe application has been loaded, including:

  • middlewares
  • controllers
  • services
  • plugins

Callback parameters:

  • app
  • caviarOptions

listening SyncHook

Triggered when the server is listened to a port

Callback parameters:

  • port number the port the server listening to
  • caviarOptions

License

MIT

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.10

5 years ago

3.0.9

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.2

5 years ago

2.0.0

5 years ago

3.0.0

5 years ago

1.0.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago