I have an Angular1.0.7 webapp that is making calls to an rails API listening in an specific port. We want to migrate to HTTPS protocol for security reasons. Is it possible to "autodetect" the protocol in the resource api call?
Example resource call:
function($resource, SERVER_URL){
var languages =
$resource('http://' + SERVER_URL +'/:action/:id', {action:'languages', id: '@id'}, {...
$resource('/:action/:id', {action:'languages', id: '@id'}
You have to try scheme relative URL like:
$resource('//' + SERVER_URL +'/:action/:id', { ...
without http:
at the beginning.