mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-21 03:47:16 +02:00
Untracked Config File
This commit is contained in:
parent
c74b397836
commit
aaf75b4402
17 changed files with 234 additions and 147 deletions
|
@ -1,24 +1,10 @@
|
|||
var express = require('express');
|
||||
var router = express.Router();
|
||||
var controller = require('./event.controller');
|
||||
var debug = require('debug')('api/event/index');
|
||||
var debug = require('debug')('rallly');
|
||||
/* GET home page. */
|
||||
|
||||
router.post('/', controller.create);
|
||||
router.get('/:id', controller.show);
|
||||
router.put('/:id', controller.update);
|
||||
router.delete('/:id', controller.delete);
|
||||
router.delete('/:id/code/:code', controller.delete);
|
||||
router.get('/:id/code/:code', controller.verifyEmail);
|
||||
|
||||
router.post('/:id/comment', controller.createComment);
|
||||
router.delete('/:id/comment/:cid', controller.deleteComment);
|
||||
|
||||
router.post('/:id/participant', controller.createParticipant);
|
||||
router.delete('/:id/participant/:pid', controller.deleteParticipant);
|
||||
router.put('/:id/participant/:pid', controller.updateParticipant);
|
||||
|
||||
router.all('/*', function(req, res){
|
||||
var after = function(req, res) {
|
||||
if (req.event){
|
||||
var event = req.event.toObject();
|
||||
delete event['__private'];
|
||||
|
@ -26,6 +12,23 @@ router.all('/*', function(req, res){
|
|||
} else {
|
||||
res.status(204).end();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
router.post('/', controller.create, after);
|
||||
router.get('/:id', controller.show, after);
|
||||
router.put('/:id', controller.update, after);
|
||||
router.delete('/:id', controller.delete, after);
|
||||
router.delete('/:id/code/:code', controller.delete, after);
|
||||
router.get('/:id/code/:code', controller.verifyEmail, after);
|
||||
|
||||
router.post('/:id/comment', controller.createComment, after);
|
||||
router.delete('/:id/comment/:cid', controller.deleteComment, after);
|
||||
|
||||
router.post('/:id/participant', controller.createParticipant, after);
|
||||
router.delete('/:id/participant/:pid', controller.deleteParticipant, after);
|
||||
router.put('/:id/participant/:pid', controller.updateParticipant, after);
|
||||
|
||||
|
||||
|
||||
|
||||
module.exports = router;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue