spee.ch/routes/page-routes.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

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