Рефакторинг

This commit is contained in:
Book Pauk
2019-01-06 17:47:16 +07:00
parent ae50597ad4
commit 0daa7110ca
3 changed files with 11 additions and 12 deletions

View File

@@ -4,9 +4,8 @@ function initRoutes(app, connPool, config) {
const misc = new c.MiscController(connPool, config);
//access
const serverMode = app.serverConfig.mode;
const [all, normal, site, reader, omnireader] = // eslint-disable-line no-unused-vars
[serverMode, 'normal', 'site', 'reader', 'omnireader'];
[config.mode, 'normal', 'site', 'reader', 'omnireader'];
//routes
const routes = [
@@ -19,7 +18,7 @@ function initRoutes(app, connPool, config) {
access = new Set(access);
let callback = () => {};
if (access.has(serverMode)) {//allowed
if (access.has(config.mode)) {//allowed
callback = async function(req, res) {
try {
const result = await controller(req, res, options);