Last active
January 11, 2017 12:10
-
-
Save aitchkhan/828e642fd5e104f6539e179754f7045d to your computer and use it in GitHub Desktop.
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
'use strict'; | |
var express = require('express'); | |
var controller = require('./post.controller'); | |
const fileUpload = require('../../lib/helpers/fileUpload'); | |
var router = express.Router(); | |
router.get('/', controller.index); | |
router.get('/:id', controller.getPostById); | |
router.post('/', fileUpload.single('image'), controller.createPost2); //this is how it is going to consume in an api or endpoint | |
router.put('/:id', controller.updatePost); | |
//router.patch('/:id', controller.patch); | |
router.delete('/:id', controller.deletePost); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment