javascript - AngularJS - Change API by SSL -


var serviceroot = 'http://myapisite.com/api/account/'; 

but want, when user come site https api change 'https://myapisite.com/api/account/'

how can it?

you can fetch scheme javascript this:

var scheme = window.location.protocol; //http: or https:  var serviceroot = scheme + '//myapisite.com/api/account/'; 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -