Skip to content

Instantly share code, notes, and snippets.

@aitchkhan
Last active January 11, 2017 12:10
Show Gist options
  • Save aitchkhan/828e642fd5e104f6539e179754f7045d to your computer and use it in GitHub Desktop.
Save aitchkhan/828e642fd5e104f6539e179754f7045d to your computer and use it in GitHub Desktop.
'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