38 lines
991 B
JavaScript
38 lines
991 B
JavaScript
/**
|
|
* This router handles things related to the web browser experience...
|
|
*/
|
|
// This is the mock data we working with...
|
|
|
|
module.exports = function (options) {
|
|
|
|
var express = options.express;
|
|
|
|
const db = options.db;
|
|
|
|
var router = express.Router();
|
|
|
|
router.route('/')
|
|
.get(function(request, response, next) {
|
|
response.render("home", {
|
|
user: request.user,
|
|
pageTitle: "HDAuth - Home"
|
|
})
|
|
});
|
|
|
|
router.route('/bsides')
|
|
.get(function(request, response, next) {
|
|
response.render("bsides", {
|
|
user: request.user,
|
|
pageTitle: "HDAuth - Bsides 2019"
|
|
})
|
|
});
|
|
|
|
// TODO: load child routers automatically
|
|
var accountRouter = require('./account/index.js')(options);
|
|
var xpubAuth = require('./xpub-auth/index.js')(options);
|
|
|
|
router.use('/account', accountRouter);
|
|
router.use('/xpub-auth', xpubAuth);
|
|
|
|
return router;
|
|
}; |