Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
introducing the request object for the index base HTML template which…
Browse files Browse the repository at this point in the history
… can utilize information such as the requests hostname, and more. This allows to specify the actual hostname for the livereload.js module instead of hard-coding localhost
  • Loading branch information
lirantal committed Oct 14, 2014
1 parent f67b7d9 commit acc091f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/core.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
exports.index = function(req, res) {
res.render('index', {
user: req.user || null
user: req.user || null,
request: req
});
};
2 changes: 1 addition & 1 deletion app/views/layout.server.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script type="text/javascript" src="http://localhost:35729/livereload.js"></script>
<script type="text/javascript" src="http://{{request.hostname}}:35729/livereload.js"></script>

{% endif %}
</body>
Expand Down

0 comments on commit acc091f

Please sign in to comment.