Backbone.js https

Be googling all morning, but can't find the answer.

The official documentation does not even have the words "https" or "ssl".

I currently have something like:

var A = backbone.Collection.extend({
  url : "a"
});

Is there a way to make https url without using an absolute path?

+5
source share
1 answer

I don’t think you can change the URL to HTTPS as it just creates the relative url of your location. Why not do something like this:

var A = Backbone.Collection.extend({
  url: function() {
    return "https://" + this.document.location.host + "/a";
  }
});
+3
source

All Articles