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
Post a Comment