Remove sl-module-loader dependencies
This commit is contained in:
parent
4582ef34dc
commit
d358ab674c
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue