Skip to content

Instantly share code, notes, and snippets.

@Raduuu
Last active Jun 22, 2020
Embed
What would you like to do?
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