p5.js-web-editor/server/routes/server.routes.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-06-23 22:29:55 +00:00
import { Router } from 'express';
2016-06-18 22:33:49 +00:00
const router = new Router();
2016-06-23 22:29:55 +00:00
import path from 'path';
2016-06-18 22:33:49 +00:00
2016-06-23 22:29:55 +00:00
// this is intended to be a temporary file
2016-06-18 22:33:49 +00:00
// until i figure out isomorphic rendering
2016-06-23 22:29:55 +00:00
router.route('/').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
2016-06-18 22:33:49 +00:00
});
2016-06-23 22:29:55 +00:00
router.route('/signup').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
2016-06-18 22:33:49 +00:00
});
2016-06-23 22:29:55 +00:00
router.route('/projects/:project_id').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
2016-06-18 22:33:49 +00:00
});
2016-08-17 22:13:17 +00:00
router.route('/full/:project_id').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
});
2016-06-23 22:29:55 +00:00
router.route('/login').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
2016-06-18 22:33:49 +00:00
});
2016-07-05 20:04:14 +00:00
router.route('/sketches').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
});
2016-08-22 16:35:59 +00:00
router.route('/about').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
});
router.route('/:username/sketches').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
});
2016-06-23 22:29:55 +00:00
export default router;