pomodoro/server/services/pomodoros/router.js
2016-09-15 14:56:19 +02:00

20 lines
512 B
JavaScript

'use strict'
const router = new (require('express')).Router()
const mw = require('./middleware')
const { isAuthenticated } = require('midwest-module-membership/passport/authorization-middleware')
router.route('/')
.get(isAuthenticated, mw.formatQuery, mw.paginate, mw.query)
.post(isAuthenticated, mw.create)
router.route('/:id')
.get(isAuthenticated, mw.findById)
.patch(isAuthenticated, mw.update)
.put(isAuthenticated, mw.replace)
.delete(isAuthenticated, mw.remove)
module.exports = router