- Update all deps - Apply midwest changes - Convert all templates to JSX - Preact instead of Marko - Babel & Eslint
20 lines
519 B
JavaScript
20 lines
519 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;
|