Comparing version 0.6.0 to 0.6.1
@@ -47,2 +47,3 @@ 'use strict'; | ||
if (!this._controllerResolver) { | ||
this.initControllers() | ||
this._controllerResolver = resolver(this.specifiedControllers, PATH_SEPARATOR) | ||
@@ -53,2 +54,11 @@ } | ||
initControllers () { | ||
if (!this.specifiedControllers) { | ||
// Lazy loading all controllers before processing any | ||
// HTTP requests. That introduces an limitation that all | ||
// routes defined after `#listen()` will be ignored. | ||
this.specifiedControllers = this._requireControllers(); | ||
} | ||
} | ||
/** | ||
@@ -88,8 +98,3 @@ * Load all controllers from disk | ||
listen() { | ||
if (!this.specifiedControllers) { | ||
// Lazy loading all controllers before processing any | ||
// HTTP requests. That introduces an limitation that all | ||
// routes defined after `#listen()` will be ignored. | ||
this.specifiedControllers = this._requireControllers(); | ||
} | ||
this.initControllers(); | ||
const server = http.createServer(this.callback()); | ||
@@ -96,0 +101,0 @@ return server.listen.apply(server, arguments); |
{ | ||
"name": "bay", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "The framework", | ||
@@ -5,0 +5,0 @@ "main": "application.js", |
49066
1637