Web: Changed to pass express subapp to services instead of the router.
This commit is contained in:
parent
275a0b57ea
commit
378edd4186
|
@ -86,7 +86,7 @@ WebService.prototype.stop = function(callback) {
|
|||
*/
|
||||
WebService.prototype.setupAllRoutes = function() {
|
||||
for(var key in this.node.services) {
|
||||
var subApp = new express.Router();
|
||||
var subApp = new express();
|
||||
var service = this.node.services[key];
|
||||
|
||||
if(service.getRoutePrefix && service.setupRoutes) {
|
||||
|
|
|
@ -103,6 +103,10 @@ describe('WebService', function() {
|
|||
|
||||
web.setupAllRoutes();
|
||||
node.services.one.setupRoutes.callCount.should.equal(1);
|
||||
should.exist(node.services.one.setupRoutes.args[0][0].engine);
|
||||
should.exist(node.services.one.setupRoutes.args[0][0].get);
|
||||
should.exist(node.services.one.setupRoutes.args[0][0].post);
|
||||
should.exist(node.services.one.setupRoutes.args[0][0].set);
|
||||
node.services.two.setupRoutes.callCount.should.equal(1);
|
||||
});
|
||||
});
|
||||
|
@ -368,4 +372,4 @@ describe('WebService', function() {
|
|||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue