Skip to content

Instantly share code, notes, and snippets.

@nomanHasan
Last active September 7, 2017 20:57
Show Gist options
  • Save nomanHasan/9f9976ba630d6bcfaafdbe21fc2dff0f to your computer and use it in GitHub Desktop.
Save nomanHasan/9f9976ba630d6bcfaafdbe21fc2dff0f to your computer and use it in GitHub Desktop.
Todo Route Complete
var express = require('express')
var router = express.Router()
// Getting the Todo Controller that we just created
var ToDoController = require('../../controllers/todos.controller');
// Map each API to the Controller FUnctions
router.get('/', ToDoController.getTodos)
router.post('/', ToDoController.createTodo)
router.put('/', ToDoController.updateTodo)
router.delete('/:id',ToDoController.removeTodo)
// Export the Router
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment