-
-
Save amandeepmittal/636d13462469d6d9f858f62bfbceba20 to your computer and use it in GitHub Desktop.
This file contains 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
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