Last active
December 18, 2019 01:07
-
-
Save paulobunga/efb9c5b612647012f399e81de511cdbd to your computer and use it in GitHub Desktop.
API endpoints for node_api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const router = express.Router(); | |
const productCtrl = require('./product_controller'); | |
router.get('/', productCtrl.viewProducts); | |
router.get('/details/:productId', productCtrl.viewSingleProduct); | |
router.patch('/update/:productId', productCtrl.updateProduct); | |
router.delete( '/delete/:productId', productCtrl.deleteProduct ); | |
router.post( '/new', productCtrl.createProduct ); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment