Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ npm-debug.log
node_modules/
demo-runthrough

.idea/
2 changes: 1 addition & 1 deletion module-2/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ app.controller('authController', function($scope){

$scope.register = function(){
//placeholder until authentication is implemented
$scope.error_message = 'registeration request for ' + $scope.user.username;
$scope.error_message = 'registration request for ' + $scope.user.username;
};
});
```
Expand Down
22 changes: 11 additions & 11 deletions module-3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,22 @@ module.exports = router;
Now that we got our **/posts** api completed we need to create some apis for individual posts. We can do this by building off of our **/posts** path and adding an ID specific route for an individual post. We use the ':' notation in our route name which tells Express that that particular part of the route will be treated as a parameter:

```js
//api for all posts
router.route('/posts')
//api for a specific post
router.route('/posts/:id')

//create a new post
.post(function(req, res){

//TODO create a new post in the database
res.send({message:"TODO create a new post in the database"});
//create
.put(function(req,res){
return res.send({message:'TODO modify an existing post by using param ' + req.param.id});
})

.get(function(req, res){

//TODO get all the posts in the database
res.send({message:"TODO get all the posts in the database"});
.get(function(req,res){
return res.send({message:'TODO get an existing post by using param ' + req.param.id});
})

.delete(function(req,res){
return res.send({message:'TODO delete an existing post by using param ' + req.param.id})
});

```

Finally our full router implementation looks like this:
Expand Down