spee.ch/server/routes/page-routes.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-03-16 10:34:26 -07:00
const { details: host } = require('../../config/siteConfig.js');
const handlePageRender = require('../helpers/handlePageRender.jsx');
2017-06-29 17:10:14 -07:00
module.exports = (app) => {
2018-02-20 15:25:04 -08:00
// route for the home page
app.get('/', (req, res) => {
handlePageRender(req, res);
2018-02-20 15:25:04 -08:00
});
2017-09-16 17:50:22 -07:00
// route to display login page
app.get('/login', (req, res) => {
handlePageRender(req, res);
2017-09-16 17:50:22 -07:00
});
// route to show 'about' page
app.get('/about', (req, res) => {
handlePageRender(req, res);
2017-07-03 11:16:51 -07:00
});
// route to display a list of the trending images
2017-09-07 12:40:35 -07:00
app.get('/trending', (req, res) => {
res.status(301).redirect('/popular');
});
app.get('/popular', (req, res) => {
handlePageRender(req, res);
2017-06-19 22:37:36 -07:00
});
2017-08-24 16:09:04 -07:00
// route to display a list of the trending images
app.get('/new', (req, res) => {
handlePageRender(req, res);
2017-08-24 16:09:04 -07:00
});
// route to send embedable video player (for twitter)
2017-08-08 13:05:29 -07:00
app.get('/embed/:claimId/:name', ({ params }, res) => {
const claimId = params.claimId;
2017-08-08 13:22:03 -07:00
const name = params.name;
2017-08-07 17:08:03 -07:00
// get and render the content
res.status(200).render('embed', { layout: 'embed', host, claimId, name });
2017-08-07 17:08:03 -07:00
});
};