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

22 lines
763 B
JavaScript
Raw Permalink Normal View History

2016-06-17 20:11:52 +02:00
import { Router } from 'express';
import * as ProjectController from '../controllers/project.controller';
import isAuthenticated from '../utils/isAuthenticated';
2016-06-17 20:11:52 +02:00
const router = new Router();
router.post('/projects', isAuthenticated, ProjectController.createProject);
2016-06-17 20:11:52 +02:00
router.put('/projects/:project_id', isAuthenticated, ProjectController.updateProject);
2016-06-19 00:33:49 +02:00
router.get('/:username/projects/:project_id', ProjectController.getProject);
2016-06-19 00:33:49 +02:00
router.delete('/projects/:project_id', isAuthenticated, ProjectController.deleteProject);
router.get('/projects', ProjectController.getProjects);
2016-07-01 17:30:40 +02:00
router.get('/:username/projects', ProjectController.getProjectsForUser);
router.get('/projects/:project_id/zip', ProjectController.downloadProjectAsZip);
2016-06-24 00:29:55 +02:00
export default router;