diff --git a/lib/application.js b/lib/application.js index cad0be9..54ee1fd 100644 --- a/lib/application.js +++ b/lib/application.js @@ -6,7 +6,6 @@ const security = require('./security.js'); const SCRIPT_OPTIONS = { timeout: 5000 }; const EMPTY_CONTEXT = Object.freeze({}); -const DIRS = ['static', 'domain', 'api']; class Application extends events.EventEmitter { constructor() { @@ -15,14 +14,16 @@ class Application extends events.EventEmitter { this.namespaces = ['db']; this.path = process.cwd(); this.staticPath = path.join(this.path, 'static'); + this.api = new Map(); + this.domain = new Map(); + this.static = new Map(); } async init() { this.createSandbox(); - for (const name of DIRS) { - this[name] = new Map(); - await this.loadPlace(name, path.join(this.path, name)); - } + await this.loadPlace('api', path.join(this.path, 'api')); + await this.loadPlace('domain', path.join(this.path, 'domain')); + await this.loadPlace('static', path.join(this.path, 'static')); } async shutdown() {