Skip to content

Instantly share code, notes, and snippets.

@Mozartted
Created February 1, 2017 14:16
Show Gist options
  • Save Mozartted/978d833a6c14ed2e620f792eed493dac to your computer and use it in GitHub Desktop.
Save Mozartted/978d833a6c14ed2e620f792eed493dac to your computer and use it in GitHub Desktop.
//the route would use the express api to perform operations
//using the Todo.Controllers.js
var Todo = require('./controller/Todo.Controllers');
//create,retrieve,update, delete
module.exports=function(app){
app.post('/api/todo',Todo.Create);//create
app.delete('/api/todo/:id',Todo.Delete);//delete
app.get('/api/todo',Todo.RetrieveAll);//retrieve
app.post('/api/todo/:id',Todo.Update);//update
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment