2014-03-24 01:49:43 +04:00
|
|
|
var frontend = require('../controllers/frontend'),
|
|
|
|
config = require('../config'),
|
|
|
|
|
|
|
|
ONE_HOUR_S = 60 * 60,
|
|
|
|
ONE_YEAR_S = 365 * 24 * ONE_HOUR_S;
|
2013-12-30 11:03:29 +04:00
|
|
|
|
2013-11-12 09:27:12 +04:00
|
|
|
module.exports = function (server) {
|
2014-03-24 01:49:43 +04:00
|
|
|
var subdir = config().paths.subdir;
|
2013-12-30 11:03:29 +04:00
|
|
|
|
2013-11-12 09:27:12 +04:00
|
|
|
// ### Frontend routes
|
|
|
|
server.get('/rss/', frontend.rss);
|
|
|
|
server.get('/rss/:page/', frontend.rss);
|
2014-03-24 01:49:43 +04:00
|
|
|
server.get('/feed/', function redirect(req, res) {
|
|
|
|
/*jshint unused:true*/
|
|
|
|
res.set({'Cache-Control': 'public, max-age=' + ONE_YEAR_S});
|
|
|
|
res.redirect(301, subdir + '/rss/');
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2014-03-06 02:03:39 +04:00
|
|
|
server.get('/tag/:slug/rss/', frontend.rss);
|
|
|
|
server.get('/tag/:slug/rss/:page/', frontend.rss);
|
2014-02-13 07:26:56 +04:00
|
|
|
server.get('/tag/:slug/page/:page/', frontend.tag);
|
|
|
|
server.get('/tag/:slug/', frontend.tag);
|
2013-11-12 09:27:12 +04:00
|
|
|
server.get('/page/:page/', frontend.homepage);
|
|
|
|
server.get('/', frontend.homepage);
|
2014-02-02 09:29:07 +04:00
|
|
|
server.get('*', frontend.single);
|
2014-03-24 01:49:43 +04:00
|
|
|
|
|
|
|
|
2013-12-30 11:03:29 +04:00
|
|
|
};
|