forked from processing/p5.js-web-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembed.routes.js
24 lines (20 loc) · 961 Bytes
/
embed.routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Router } from 'express';
const editorUrl = process.env.EDITOR_URL;
const router = new Router();
// CAT redirecting these temporarily to editor URLS to prevent phishing
// router.get('/:username/embed/:project_id', EmbedController.serveProject);
router.get('/:username/embed/:project_id', (req, res) => {
const { username, project_id: projectId } = req.params;
res.redirect(301, `${editorUrl}/${username}/full/${projectId}`);
});
// router.get('/:username/present/:project_id', EmbedController.serveProject);
router.get('/:username/present/:project_id', (req, res) => {
const { username, project_id: projectId } = req.params;
res.redirect(301, `${editorUrl}/${username}/full/${projectId}`);
});
// router.get('/embed/:project_id', EmbedController.serveProject);
router.get('/embed/:project_id', (req, res) => {
const { project_id: projectId } = req.params;
res.redirect(301, `${editorUrl}/full/${projectId}`);
});
export default router;