Skip to content

Instantly share code, notes, and snippets.

@Raduuu
Last active June 22, 2020 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raduuu/f10997f4df6b8875b968b7d4b50db2ce to your computer and use it in GitHub Desktop.
Save Raduuu/f10997f4df6b8875b968b7d4b50db2ce to your computer and use it in GitHub Desktop.
import { Router } from 'express'
import controllers from './product.controllers'
const router = Router()
// /product
router
.route('/')
.get(controllers.getMany)
.post(controllers.createOne)
// /product/:id
router
.route('/:id')
.get(controllers.getOne)
.put(controllers.updateOne)
.delete(controllers.removeOne)
export default router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment