added sitemap.xml to routes, closes #96

This commit is contained in:
Julian Lam
2013-07-17 22:35:16 -04:00
parent 6e91810231
commit 1fa900e615
2 changed files with 81 additions and 21 deletions

View File

@@ -229,6 +229,14 @@ var express = require('express'),
res.send(app.build_header(res) + '<script>templates.ready(function(){ajaxify.go("confirm/' + req.params.code + '");});</script>' + templates['footer']);
});
app.get('/sitemap.xml', function(req, res) {
var sitemap = require('./sitemap.js');
sitemap.render(function(xml) {
res.type('xml').set('Content-Length', xml.length).send(xml);
});
});
app.get('/api/:method', api_method);
app.get('/api/:method/:id', api_method);
// ok fine MUST ADD RECURSION style. I'll look for a better fix in future but unblocking baris for this:
@@ -262,22 +270,6 @@ var express = require('express'),
});
});
app.get('/test', function(req, res) {
/*user.get_userslugs_by_uids([1,2], function(data) {
res.send(data);
});*/
var gravatar= require('gravatar');
var img = gravatar.url('', {}, https=false);
res.send(img);
// 'http://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e'
/* categories.getCategoryById(1,1, function(data) {
res.send(data);
},1);*/
});
});
// These functions are called via ajax once the initial page is loaded to populate templates with data
@@ -407,11 +399,6 @@ var express = require('express'),
break;
}
}
}(WebServer));
server.listen(nconf.get('port'));