I would like to know how to resolve the request problem between a local and production environment.
Example:
I have a JS function that takes the context of the application and concatenates it with the request.
var ctx = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2));
ctx+'/Portal/listaProdutos'
Locally, you would find: localhost: 8080 / "application_name" / Portal / listProducts
But in production, the requests are taking the duplicate context: www.nomedosite.com/Portal/Portal/listProducts.
How do I solve this problem?
Another tip:
I also have request like this: ctx+'/carregaBarSearch'
, being that I'm browsing pages with context /Portal
, www.nomedosite.com/Portal/Home