Контроллеры маршрутов

This commit is contained in:
Book Pauk
2018-12-27 14:23:08 +07:00
parent bf168c5bf2
commit 552e82bef0
4 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
class BaseController {
constructor(connPool, config) {
this.connPool = connPool;
this.config = config;
}
}
module.exports = BaseController;

View File

@@ -0,0 +1,11 @@
const log = require('../core/getLogger').getLog();
const BaseController = require('./BaseController');
const Lazy = require('lazy.js');
class MiscController extends BaseController {
async configValue(req) {
return Lazy(this.config).pick([req.params.name]).toObject();
}
}
module.exports = MiscController;

View File

@@ -0,0 +1,3 @@
module.exports = {
MiscController: require('./MiscController'),
}