Remove sl-module-loader dependencies

This commit is contained in:
Ritchie 2013-06-17 08:18:31 -07:00
parent 4582ef34dc
commit d358ab674c
2 changed files with 0 additions and 57 deletions

View File

@ -1,25 +0,0 @@
/**
* Module dependencies.
*/
var ModuleLoader = require('sl-module-loader');
/**
* Export the middleware.
*/
module.exports = middleware;
/**
* Load application modules based on the current directories configuration files.
*/
function middleware() {
var modules = this.modules;
return function executeAsteroidMiddleware(req, res, next) {
// TODO implement asteroid specific middleware stack
next();
}
}

View File

@ -1,32 +0,0 @@
/**
* Module dependencies.
*/
var asteroid = require('../asteroid');
/**
* Export the middleware.
*/
module.exports = routes;
/**
* Build a temp app for mounting resources.
*/
function routes() {
return function (req, res, next) {
// xxx - cache the temp app and only build when modules change?
var tempApp = asteroid();
var routes = req.modules.instanceOf('Route');
// mount all resources
routes.forEach(function (r) {
r.mount(tempApp);
});
tempApp.handle(req, res, next);
}
}