Created
April 29, 2018 06:25
-
-
Save jlozovei/9d3fa40c941e23e3c2fa338c74ea9414 to your computer and use it in GitHub Desktop.
publication routes - node api tutorial
This file contains 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
'use strict' | |
const express = require('express') | |
const router = express.Router() | |
const PublicationController = require('../../controllers/PublicationController') | |
const auth = require('../auth') | |
router.get('/', auth, PublicationController.getAll) | |
router.get('/:_id', auth, PublicationController.getById) | |
router.post('/', auth, PublicationController.create) | |
router.put('/:_id', auth, PublicationController.update) | |
router.put('/stars/:_id', auth, PublicationController.updateStars) | |
router.put('/report/:_id', auth, PublicationController.updateReport) | |
router.delete('/:_id', auth, PublicationController.remove) | |
module.exports = router |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment