messages.js 435 B

12345678910111213
  1. const express = require('express');
  2. const router = express.Router();
  3. const guard = require('../helpers/guard');
  4. const controllers = require('../controllers/messages');
  5. const validation = require('../validation/message');
  6. router
  7. .get('/', guard, controllers.listMessages)
  8. .post('/', guard, validation.sentMessage, controllers.sentMessage);
  9. router.get('/:companionId', guard, controllers.listMessagesById);
  10. module.exports = router;