Reorder middleware to fix unit-test failures.

LoopBack REST adapter owns the whole URL space and does not let other
middleware handle same URLs. It's possible to circumvent this measure
by installing the explorer middleware before the REST middleware.
This commit is contained in:
Miroslav Bajtos 2013-12-09 11:44:46 +01:00
parent f872275e10
commit 1ca2d2ccad
1 changed files with 5 additions and 1 deletions

View File

@ -71,8 +71,12 @@ describe('explorer', function() {
app.use(restUrlBase, loopback.rest()); app.use(restUrlBase, loopback.rest());
app.use('/explorer', explorer(app, { basePath: restUrlBase })); app.use('/explorer', explorer(app, { basePath: restUrlBase }));
} else { } else {
app.use(loopback.rest()); // LoopBack REST adapter owns the whole URL space and does not
// let other middleware handle same URLs.
// It's possible to circumvent this measure by installing
// the explorer middleware before the REST middleware.
app.use('/explorer', explorer(app)); app.use('/explorer', explorer(app));
app.use(loopback.rest());
} }
done(); done();
} }