dolittle / Bifrost

This is the stable release of Dolittle till its out of alpha->beta stages
Other
110 stars 38 forks source link

Automatically use origin of the Bifrost Application script as the origin for requests #827

Closed einari closed 7 years ago

einari commented 7 years ago

Views + ViewModels + performing things through Server.js - POST / GET - base-URL - by convention use the origin of the Bifrost Application script:

var currentScript = document.currentScript || (function() {
  var scripts = document.getElementsByTagName('script');
  return scripts[scripts.length - 1];
})();

Found here

svethors commented 7 years ago

Latest pull request for this issue has a tentative fix for commands, and a slightly different implementation that does not require Bifrost to be the last script tag in the html document. It uses jQuery to select the script tag that has an src containing "Bifrost/Application".

The above convention for views and viewmodels seem to have the same requirement?

This caused problems when adding a require config section, with text -> useXhr returning true, after the Bifrost/Application script tag. This config should however probably be part of Bifrost?