How to place a variable in the middle of the route at the angle

Asked

Viewed 89 times

0

Hello, I am developing a front end that will connect with several equal API’s, but with distinct banks( The Client has the API installed, but this front is for employee access, and for the sake of decreasing maintenance updating in all customers we will host the front in a single location and make the control of where to access), however to know which API to access would make him take the route, but as the idea is to host in a single URL I would like to put the name of the company responsible for the API that I will access. For example

www.mycompany.com/{Variavelcomnomedocliente}/{Normal angular routes}

ai with Variavelcomnomedocliente would make a URL control to find the right API.

1 answer

0

You could set a global variable for example who knows in the app.js

var enderecos = {
    cliente1: 'www.minhaempresa.com/nomeCLiente1/',
    cliente2: 'www.minhaempresa.com/nomeCLiente2/',
}

ai at the time of calling could do

enderecos.cliente1 + 'rota-normal'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.