Мне нужно изменить маршруты на определенных страницах, затем я отхожу от серверной части и автоматически генерирую значения при нажатии кнопок или в гиперссылке href ...
ПРИМЕЧАНИЕ: Я передаю значения из бэкэнда, потому что для достижения этих значений я использую params.
Я использую NODEJS + EXPRESS
<!-- EM CONSTRUÇÃO -->
<header>
<nav class="navbar navbar-expand navbar-light bg-lilas-2 fixed-top <%= informations.checking.has.ShopkeeperComparePage ? 'shadow' : null; %>">
<div class="container-fluid d-flex justify-content-between">
<div>
<% if(informations.checking.has.HomePage) { %>
<button type="button" class="btn btn-default bg-transparent shadow-none" data-toggle="modal" data-target="#filter"><i class="menu-options-icon text-lilas-1"></i></button>
<% } else if(informations.checking.has.ShoppingPage) { %>
<button onClick="document.location.replace('/home/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=<%= informations.HTTP.querys.Indicator %>')" type="button" class="btn btn-lg bg-transparent shadow-none"><i class="back-arrow-icon text-lilas-1"></i></button>
<% } else if(informations.checking.has.ShopkeeperPage) { %>
<button onClick="document.location.replace('/shopping/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=<%= informations.HTTP.querys.Indicator %>')" type="button" class="btn btn-lg bg-transparent shadow-none"><i class="back-arrow-icon text-lilas-1"></i></button>
<% } else if(informations.checking.has.ShopkeeperDetailsPage) { %>
<button onClick="document.location.replace('/lojista/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=<%= informations.HTTP.querys.Indicator %>')" type="button" class="btn btn-lg bg-transparent shadow-none"><i class="back-arrow-icon text-lilas-1"></i></button>
<% } else if(informations.checking.has.ShopkeeperComparePage) { %>
<button onClick="document.location.replace('/lojistadetalhes/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=<%= informations.HTTP.querys.Indicator %>')" type="button" class="btn btn-lg bg-transparent shadow-none"><i class="back-arrow-icon text-lilas-1"></i></button>
<% } %>
</div>
<div class="flex-fill text-center ml-4 pl-sm-2">
<span class="navbar-brand text-white"><%= informations.page.general.titles.navbar %></span>
</div>
<div>
<% if(informations.checking.has.ShopkeeperDetailsPage) { %>
<button onClick="(document.getElementById('BTNSWI').getAttribute('data-indicator') === 'm²') ? document.location.replace('/<%= informations.page.general.type %>/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&Storename=<%= informations.HTTP.querys.Storename %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=M2') : document.location.replace('/<%= informations.page.general.type %>/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&Storename=<%= informations.HTTP.querys.Storename %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=ABS');" type="button" id="BTNSWI" class="btn btn-sm btn-switch-indicator shadow-none" data-toggle="button" data-indicator="<%= (informations.page.data.API.indicatorType === 'm²') ? 'abs' : 'm²' %>" aria-pressed="false" autocomplete="off">
<div id="teste" class="handle-switch-indicator"></div>
</button>
<% } else { %>
<button onClick="(document.getElementById('BTNSWI').getAttribute('data-indicator') === 'm²') ? document.location.replace('/<%= informations.page.general.type %>/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=M2') : document.location.replace('/<%= informations.page.general.type %>/v1/query?Shop=<%= informations.HTTP.querys.Shop %>&PeriodOf=<%= informations.HTTP.querys.PeriodOf %>&PeriodUntil=<%= informations.HTTP.querys.PeriodUntil %>&PeriodType=<%= informations.HTTP.querys.PeriodType %>&Indicator=ABS');" type="button" id="BTNSWI" class="btn btn-sm btn-switch-indicator shadow-none" data-toggle="button" data-indicator="<%= (informations.page.data.API.indicatorType === 'm²') ? 'abs' : 'm²' %>" aria-pressed="false" autocomplete="off">
<div id="teste" class="handle-switch-indicator"></div>
</button>
<% } %>
</div>
</div>
</nav>
</header>