Skip to content

Commit

Permalink
Add routes and other necessaries for /breaches and /security-tips pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyjanenorton committed Apr 17, 2019
1 parent 6a2819a commit ef1b69a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions controllers/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ async function home(req, res) {
});
}

const getAllBreaches = (req, res) => {
return res.render("top-level-page", {
title: "All the breaches",
whichPartial: "top-level/all-breaches",
});
};

const getSecurityTips = (req, res) => {
return res.render("top-level-page", {
title: "Security Tip Page Title Needed",
whichPartial: "top-level/security-tips",
});
};

function notFound(req, res) {
res.status(404);
res.render("subpage", {
Expand All @@ -62,5 +76,7 @@ function notFound(req, res) {

module.exports = {
home,
getAllBreaches,
getSecurityTips,
notFound,
};
4 changes: 3 additions & 1 deletion routes/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
const express = require("express");
const csrf = require("csurf");

const {home, notFound} = require("../controllers/home");
const {home, getAllBreaches, getSecurityTips, notFound} = require("../controllers/home");


const router = express.Router();
const csrfProtection = csrf();

router.get("/", csrfProtection, home);
router.get("/breaches", getAllBreaches);
router.get("/security-tips", getSecurityTips);
router.use(notFound);

module.exports = router;
Empty file.
Empty file.
1 change: 1 addition & 0 deletions views/top-level-page.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{> (lookup . 'whichPartial') }}

0 comments on commit ef1b69a

Please sign in to comment.