upload.js 458 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. /** Get controllers */
  3. const uploadController = require('../controllers/upload');
  4. const authMiddleware = require('../middlewares/auth');
  5. /**
  6. * Upload routes
  7. * You can upload images to the server
  8. *
  9. * @param {Router} - express router
  10. */
  11. module.exports = function (router) {
  12. /**
  13. * Upload images
  14. */
  15. router.route('/upload')
  16. /** POST /upload - Upload images */
  17. .post(authMiddleware, uploadController.uploadImage);
  18. return router;
  19. }