p5.js-web-editor/server/routes/server.routes.js
Cassie Tarakajian e87390adb9 update eslint to latest version, fix lots of linting errors (#308)
* update eslint and dependencies, fix linting errors that can be fixed with --fix

* fix lots of linting errors

* update eslintrc, fix some linting errors

* fix all server side linting errors, untested

* fix errors that fixing linting errors had caused

* fix client side eslint errors

* fix client side linting errors

* fix refs lint errors

* fix more linting errors

* update eslint and dependencies, fix linting errors that can be fixed with --fix

* fix lots of linting errors

* update eslintrc, fix some linting errors

* fix all server side linting errors, untested

* fix errors that fixing linting errors had caused

* fix client side eslint errors

* fix client side linting errors

* fix refs lint errors

* fix more linting errors

* fix some accessibility linting errors

* fix a lot of linting errors

* fix a billion more linting errors

* hopefully fix all linting errors, still need to test

* fix bugs that fixing linting had caused
2017-02-22 14:29:35 -05:00

57 lines
1.3 KiB
JavaScript

import { Router } from 'express';
import { renderIndex } from '../views/index';
import { get404Sketch } from '../views/404Page';
import { userExists } from '../controllers/user.controller';
const router = new Router();
// this is intended to be a temporary file
// until i figure out isomorphic rendering
router.route('/').get((req, res) => {
res.send(renderIndex());
});
router.route('/signup').get((req, res) => {
res.send(renderIndex());
});
router.route('/projects/:project_id').get((req, res) => {
res.send(renderIndex());
});
router.route('/:username/sketches/:project_id').get((req, res) => {
res.send(renderIndex());
});
// router.route('/full/:project_id').get((req, res) => {
// res.send(renderIndex());
// });
router.route('/login').get((req, res) => {
res.send(renderIndex());
});
router.route('/reset-password').get((req, res) => {
res.send(renderIndex());
});
router.route('/reset-password/:reset_password_token').get((req, res) => {
res.send(renderIndex());
});
router.route('/sketches').get((req, res) => {
res.send(renderIndex());
});
router.route('/about').get((req, res) => {
res.send(renderIndex());
});
router.route('/:username/sketches').get((req, res) => {
userExists(req.params.username, exists => (
exists ? res.send(renderIndex()) : get404Sketch(html => res.send(html))
));
});
export default router;