2016-06-17 18:11:52 +00:00
|
|
|
import { Router } from 'express';
|
|
|
|
import * as ProjectController from '../controllers/project.controller';
|
2018-01-09 20:57:49 +00:00
|
|
|
import isAuthenticated from '../utils/isAuthenticated';
|
2016-06-17 18:11:52 +00:00
|
|
|
|
|
|
|
const router = new Router();
|
|
|
|
|
2018-01-09 20:57:49 +00:00
|
|
|
router.post('/projects', isAuthenticated, ProjectController.createProject);
|
2016-06-17 18:11:52 +00:00
|
|
|
|
2018-01-09 20:57:49 +00:00
|
|
|
router.put('/projects/:project_id', isAuthenticated, ProjectController.updateProject);
|
2016-06-18 22:33:49 +00:00
|
|
|
|
2020-05-26 21:35:13 +00:00
|
|
|
router.get('/:username/projects/:project_id', ProjectController.getProject);
|
2016-06-18 22:33:49 +00:00
|
|
|
|
2018-01-09 20:57:49 +00:00
|
|
|
router.delete('/projects/:project_id', isAuthenticated, ProjectController.deleteProject);
|
2016-10-12 18:24:53 +00:00
|
|
|
|
2018-01-09 20:57:49 +00:00
|
|
|
router.get('/projects', ProjectController.getProjects);
|
2016-07-01 15:30:40 +00:00
|
|
|
|
2018-01-09 20:57:49 +00:00
|
|
|
router.get('/:username/projects', ProjectController.getProjectsForUser);
|
2016-08-17 19:53:25 +00:00
|
|
|
|
2018-01-09 20:57:49 +00:00
|
|
|
router.get('/projects/:project_id/zip', ProjectController.downloadProjectAsZip);
|
2016-11-02 18:08:53 +00:00
|
|
|
|
2016-06-23 22:29:55 +00:00
|
|
|
export default router;
|