Dynamic Routing Beta: Reordered router hierarchy

refs #9601

- static routes are stronger than taxonomy
This commit is contained in:
kirrg001 2018-06-24 00:32:00 +02:00 committed by Katharina Irrgang
parent 3cdff10350
commit d0f2b3e7ad

View File

@ -32,13 +32,6 @@ module.exports = function bootstrap() {
const dynamicRoutes = settingsService.get('routes');
_.each(dynamicRoutes.taxonomies, (value, key) => {
const taxonomyRouter = new TaxonomyRouter(key, value);
siteRouter.mountRouter(taxonomyRouter.router());
registry.setRouter(taxonomyRouter.identifier, taxonomyRouter);
});
_.each(dynamicRoutes.routes, (value, key) => {
const staticRoutesRouter = new StaticRoutesRouter(key, value);
siteRouter.mountRouter(staticRoutesRouter.router());
@ -46,6 +39,13 @@ module.exports = function bootstrap() {
registry.setRouter(staticRoutesRouter.identifier, staticRoutesRouter);
});
_.each(dynamicRoutes.taxonomies, (value, key) => {
const taxonomyRouter = new TaxonomyRouter(key, value);
siteRouter.mountRouter(taxonomyRouter.router());
registry.setRouter(taxonomyRouter.identifier, taxonomyRouter);
});
_.each(dynamicRoutes.collections, (value, key) => {
const collectionRouter = new CollectionRouter(key, value);
siteRouter.mountRouter(collectionRouter.router());