Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 3, 2018 04:35
Show Gist options
  • Save amandeepmittal/636d13462469d6d9f858f62bfbceba20 to your computer and use it in GitHub Desktop.
Save amandeepmittal/636d13462469d6d9f858f62bfbceba20 to your computer and use it in GitHub Desktop.
const todosController = require('../controllers/todos.js');
const todoItemsController = require('../controllers/todoitem.js');
module.exports = app => {
app.get('/api', (req, res) =>
res.status(200).send({
message: 'Create Your Own Todo Lists API'
})
);
app.post('/api/todos', todosController.create);
app.get('/api/todos', todosController.list);
app.post('/api/todos/:todoId/items', todoItemsController.create);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment