How to use @ditojs/router - 1 common examples

To help you get started, we’ve selected a few @ditojs/router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ditojs / dito / packages / server / src / app / Application.js View on Github external
constructor(
    config = {},
    { validator, router, events, models, controllers, services }
  ) {
    super()
    this.setupEmitter(events)
    // Pluck keys out of `config.app` to keep them secret
    const { keys, ...app } = config.app || {}
    this.config = { ...config, app }
    this.keys = keys
    this.proxy = !!app.proxy
    this.validator = validator || new Validator()
    this.router = router || new Router()
    this.validator.app = this
    this.storages = Object.create(null)
    this.models = Object.create(null)
    this.services = Object.create(null)
    this.controllers = Object.create(null)
    this.hasControllerMiddleware = false
    this.setupGlobalMiddleware()
    this.setupKnex()
    if (config.storages) {
      this.addStorages(config.storages)
    }
    if (models) {
      this.addModels(models)
    }
    if (services) {
      this.addServices(services)

@ditojs/router

Dito.js Router – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js

MIT
Latest version published 1 day ago

Package Health Score

61 / 100
Full package analysis

Popular @ditojs/router functions