Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down