Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

generate url for homepage

  • Loading branch information...
commit f76e142f8038b95107c155096e3fdef4c7f62edd 1 parent 2dd1272
Ali Asaria authored
Showing with 5 additions and 2 deletions.
  1. +4 −1 server.js
  2. +1 −1  views/home.jade
View
5 server.js
@@ -36,8 +36,11 @@ app.configure( function(){
});
app.get('/', function(req, res) {
+ console.log(req.header('host'));
+ url = req.header('host');
res.render('home.jade', {
- layout: false
+ layout: false,
+ locals: {url: url}
});
});
View
2  views/home.jade
@@ -28,7 +28,7 @@ body
a#go(onclick="return go();")  go.
<br><br>
p.home example board:
- p.home <a href="http://scrumblr.ca/demo">http://scrumblr.ca/demo</a>
+ p.home!= '<a href="http://' + locals.url + '/demo">' + locals.url + '/demo</a>'
<br><br><br>
p.home.small sourcecode at <a href="https://github.com/aliasaria/scrumblr">github</a>
Please sign in to comment.
Something went wrong with that request. Please try again.