123456789101112131415 |
- const express = require('express');
- const router = express.Router();
- const guard = require('../helpers/guard');
- const controllers = require('../controllers/contacts');
- const validation = require('../validation/contact');
- router
- .get('/', guard, controllers.listContacts)
- .post('/', guard, validation.createContact, controllers.addContact)
- .patch('/', guard, validation.updateContact, controllers.updateContact);
- router
- .get('/:number', guard, controllers.getContactById)
- .delete('/:id', guard, controllers.removeContact);
- module.exports = router;
|