fix should be /news for show views
This commit is contained in:
@ -89,13 +89,19 @@ module.exports = function(app) {
|
|||||||
router.get('/stories/submit/new-story', preSubmit);
|
router.get('/stories/submit/new-story', preSubmit);
|
||||||
router.post('/stories/preliminary', newStory);
|
router.post('/stories/preliminary', newStory);
|
||||||
router.post('/stories/', storySubmission);
|
router.post('/stories/', storySubmission);
|
||||||
router.get('/stories/', hot);
|
router.get('/news/', hot);
|
||||||
router.post('/stories/search', getStories);
|
router.post('/stories/search', getStories);
|
||||||
router.get('/stories/:storyName', returnIndividualStory);
|
router.get('/news/:storyName', returnIndividualStory);
|
||||||
router.post('/stories/upvote/', upvote);
|
router.post('/stories/upvote/', upvote);
|
||||||
|
router.get('/stories/:storyName', redirectToNews);
|
||||||
|
|
||||||
app.use(router);
|
app.use(router);
|
||||||
|
|
||||||
|
function redirectToNews(req, res) {
|
||||||
|
var url = req.originalUrl.replace(/^\/stories/, '/news');
|
||||||
|
return res.redirect(url);
|
||||||
|
}
|
||||||
|
|
||||||
function hotJSON(req, res, next) {
|
function hotJSON(req, res, next) {
|
||||||
var query = {
|
var query = {
|
||||||
order: 'timePosted DESC',
|
order: 'timePosted DESC',
|
||||||
|
Reference in New Issue
Block a user