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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -