mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
e1c0c5ce98
no issue - acquiring a new access token using a refresh token sets the expiration time of the refresh token to now + 24 hrs. - moved all occurrences of ONE_HOUR, ONE_DAY and ONE_YEAR to `core/server/utils`
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
var frontend = require('../controllers/frontend'),
|
|
config = require('../config'),
|
|
express = require('express'),
|
|
utils = require('../utils'),
|
|
|
|
frontendRoutes;
|
|
|
|
frontendRoutes = function () {
|
|
var router = express.Router(),
|
|
subdir = config.paths.subdir;
|
|
|
|
// ### Frontend routes
|
|
router.get('/rss/', frontend.rss);
|
|
router.get('/rss/:page/', frontend.rss);
|
|
router.get('/feed/', function redirect(req, res) {
|
|
/*jshint unused:true*/
|
|
res.set({'Cache-Control': 'public, max-age=' + utils.ONE_YEAR_S});
|
|
res.redirect(301, subdir + '/rss/');
|
|
});
|
|
|
|
// Tags
|
|
router.get('/tag/:slug/rss/', frontend.rss);
|
|
router.get('/tag/:slug/rss/:page/', frontend.rss);
|
|
router.get('/tag/:slug/page/:page/', frontend.tag);
|
|
router.get('/tag/:slug/', frontend.tag);
|
|
|
|
// Authors
|
|
router.get('/author/:slug/rss/', frontend.rss);
|
|
router.get('/author/:slug/rss/:page/', frontend.rss);
|
|
router.get('/author/:slug/page/:page/', frontend.author);
|
|
router.get('/author/:slug/', frontend.author);
|
|
|
|
// Default
|
|
router.get('/page/:page/', frontend.homepage);
|
|
router.get('/', frontend.homepage);
|
|
router.get('*', frontend.single);
|
|
|
|
return router;
|
|
};
|
|
|
|
module.exports = frontendRoutes; |