Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 1.08 KB

File metadata and controls

35 lines (29 loc) · 1.08 KB

Load Services or Libs

const KsMf = require('ksmf');

class DefaultController extends KsMf.app.Controller {

    list(req, res) {
        const externalController = this.helper.get({
            name: 'AddressController',
            path: 'controller',
            module: 'person',
            options: {
                opt: this.opt
            },
            dependency: {
                'helper': 'helper'
            }
        });
        const data = externalController.list(req, res);
        res.json({ data });
    }
}

module.exports = DefaultController;

This microframework uses KsDp allowing you to make use of integration patterns such as the IoC, in this way you can access any library or service of the project without having to load it or explicitly intanciate it.

Related topics

The next recomended topic: Data Base.