Skip to content

Instantly share code, notes, and snippets.

@Adurtxi
Last active August 9, 2021 10:28
Show Gist options
  • Select an option

  • Save Adurtxi/251e61d5d3b884069248f70adc770e15 to your computer and use it in GitHub Desktop.

Select an option

Save Adurtxi/251e61d5d3b884069248f70adc770e15 to your computer and use it in GitHub Desktop.
NodeJS, Express and MySQL -- document.routes.js
const express = require('express');
const router = express.Router();
const documentController = require('@controllers/document.controller');
router.get('/', documentController.getAll);
router.get('/:id', documentController.getById);
router.post('/', documentController.store);
router.put('/:id', documentController.update);
router.delete('/:id', documentController.delete);
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment