waibu 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/app.js CHANGED
@@ -28,6 +28,11 @@ export async function boot () {
28
28
  const mods = await collect.call(this)
29
29
  await runHook(`${this.name}:beforeAppBoot`)
30
30
  for (const m of mods) {
31
+ const disabled = this.app[m.ns].config.disabled
32
+ if (Array.isArray(disabled) && disabled.length === 1 && ['*', 'all'].includes(disabled[0])) {
33
+ this.log.warn('All %s routes are disabled by config', m.ns)
34
+ continue
35
+ }
31
36
  await runHook(`${this.name}.${m.ns}:beforeAppBoot`)
32
37
  this.log.debug('Boot app: %s', m.ns)
33
38
  await this.instance.register(async (ctx) => {
@@ -59,6 +59,7 @@ async function attachI18N (detector = [], req, reply) {
59
59
  if (req.lang) opts.lng = req.lang
60
60
  req.i18n = this.app.bajoI18N.instance.cloneInstance(opts)
61
61
  req.t = (...args) => {
62
+ // console.log(args)
62
63
  // const defNs = get(req, 'routeOptions.config.ns', this.name)
63
64
  return translate.call(this.app[defNs], req.i18n, ...args)
64
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {