Skip to content

Commit

Permalink
Merge pull request ember-cli#18 from pixelhandler/baseurl
Browse files Browse the repository at this point in the history
Add baseUrl to script path for ember-cli-live-reload.js
  • Loading branch information
rwjblue committed Jan 30, 2015
2 parents bb3a2b4 + 3ddd71f commit f60c067
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ module.exports = {

contentFor: function(type) {
var liveReloadPort = process.env.EMBER_CLI_INJECT_LIVE_RELOAD_PORT;
var baseURL = process.env.EMBER_CLI_INJECT_LIVE_RELOAD_BASEURL;

if (liveReloadPort && type === 'head') {
return '<script src="/ember-cli-live-reload.js" type="text/javascript"></script>';
return '<script src="' + baseURL + 'ember-cli-live-reload.js" type="text/javascript"></script>';
}
},

Expand All @@ -31,8 +32,9 @@ module.exports = {
if (options.liveReload !== true) { return; }

process.env.EMBER_CLI_INJECT_LIVE_RELOAD_PORT = options.liveReloadPort;
process.env.EMBER_CLI_INJECT_LIVE_RELOAD_BASEURL = options.baseURL; // default is '/'

app.use('/ember-cli-live-reload.js', function(request, response, next) {
app.use(options.baseURL + 'ember-cli-live-reload.js', function(request, response, next) {
response.contentType('text/javascript');
response.send(self.dynamicScript());
});
Expand Down

0 comments on commit f60c067

Please sign in to comment.