15.4.1 • Published 5 years ago

@the-/controller v15.4.1

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

@the-/controller

npm Version

Base of the-controllers

Installation

$ npm install @the-/controller --save

Usage

'use strict'

const { TheCtrl } = require('@the-/controller')
const theServer = require('@the-/server')

async function tryExample() {
  // Create server instance
  const server = theServer({
    /* ... */
  })

  class FruitShopCtrl extends TheCtrl {
    async buy(name, amount = 1) {
      // Controller instance will be created per client
      const {} = this
      /* ... */
    }
  }

  server.register(FruitShopCtrl, 'fruitShop')

  server.listen(3000)
}

tryExample().catch((err) => console.error(err))

API Guide

function

class

License

This software is released under the MIT License.

Links

15.4.1

5 years ago

15.2.0

5 years ago

15.1.4

5 years ago

15.1.3

5 years ago

15.1.2

5 years ago

15.1.0

5 years ago

15.0.3

5 years ago