Ghost/core/server/routes/frontend.js

20 lines
715 B
JavaScript
Raw Normal View History

2013-11-21 22:44:18 +04:00
var frontend = require('../controllers/frontend'),
api = require('../api');
module.exports = function (server) {
// ### Frontend routes
/* TODO: dynamic routing, homepage generator, filters ETC ETC */
server.get('/rss/', frontend.rss);
server.get('/rss/:page/', frontend.rss);
server.get('/page/:page/', frontend.homepage);
server.get('/', frontend.homepage);
api.settings.read('permalinks').then(function (permalinks) {
if (permalinks.value !== '/:slug/') {
server.get('/:slug/', frontend.page);
server.get(permalinks.value, frontend.post);
} else {
server.get(permalinks.value, frontend.single);
}
});
2013-11-21 22:44:18 +04:00
};