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