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

22 lines
763 B
JavaScript
Raw Permalink Normal View History

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