Skip to content

Commit

Permalink
correction
Browse files Browse the repository at this point in the history
  • Loading branch information
rajats98 committed Jan 16, 2020
1 parent 05de461 commit 6278982
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

4 changes: 2 additions & 2 deletions helpers/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var db = require('../models');
exports.getTodos = function(req,res) {
db.Todo.find()
.then(function(todos) {
res.status(201).json(todos);
res.json(todos);
})
.catch(function(err) {
res.send(err);
Expand All @@ -13,7 +13,7 @@ exports.getTodos = function(req,res) {
exports.createTodo = function(req,res){
db.Todo.create(req.body)
.then(function(newTodo) {
res.json(newTodo);
res.status(201).json(newTodo);
})
.catch(function(err) {
res.send(err);
Expand Down
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ app.get('/',function(req,res) {

app.use('/api/todos', todoRoutes);




app.listen(process.env.PORT || 5000,function(){
console.log("Server Started");
});

0 comments on commit 6278982

Please sign in to comment.