Wire hot, recent, submit, and search views in app and controller, modified button navigation to fetch their routes

This commit is contained in:
Nathan Leniz
2015-03-06 08:11:18 +09:00
parent f1f3258fe3
commit 5440efc729
7 changed files with 140 additions and 25 deletions

49
app.js
View File

@@ -281,17 +281,20 @@ app.post(
* Main routes.
*/
app.get(
'/stories/',
storyController.index
);
app.get(
'/stories/index',
storyController.json
'/stories/hotStories',
storyController.hotJSON
);
app.post(
'/stories/comment/submit',
storyController.commentSubmit
app.get(
'/stories/recentStories',
storyController.recentJSON
);
app.get(
'/stories/',
function(req, res) {
res.redirect(302, '/stories/hot');
}
);
app.get(
@@ -299,15 +302,43 @@ app.get(
storyController.comments
);
app.post(
'/stories/comment/submit',
storyController.commentSubmit
);
app.get(
'/stories/submit',
storyController.submitNew
);
app.post(
'/stories/submit',
storyController.storySubmission
);
app.get(
'/stories/hot',
storyController.hot
);
app.get(
'/stories/recent',
storyController.recent
);
app.get(
'/stories/search',
storyController.search
);
app.get(
'/stories/:storyName',
storyController.returnIndividualStory
);
app.post(
'/stories/upvote/',
storyController.upvote