The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Save and Delete Content in Express with HTTP Verbs

Save and Delete Content in Express with HTTP Verbs

7:04
In this lesson you will learn how to support data modification by handling HTTP verbs besides GET. We will look at how to edit, save, and delete content with `.put` and `.delete`.
Watch this lesson now
Avatar
egghead.io

In this lesson you will learn how to support data modification by handling HTTP verbs besides GET.

Avatar
Martin

I'm sure if it's deliberate, but it's like you skipping over the part surrounding the getUser function. I seems straightforward, but there's no real description to the change from the list to the actual user files. At least not what I can see.

Avatar
Ben

Woah, you're right. Sorry about that!

In reply to Martin
Avatar
Vishwas

The tutorials going great but missing out on the utility functions and how they handling data throws me off and I can't follow as I am trying to build the app following the video.

Avatar
Stefan

Hey, i found one problem if i start my server with "npm dev" from your previous lectures, not load a user picture because server restarting and not return picture. Do you have a solution about it ?

Avatar
Ben

Hi Stefan,

I'm not seeing that issue.What action in the app is causing the server to restart? If it's editing a user, one thing you could try is changing the dev script to tell nodemon to ignore the users directory. nodemon index.js --ignore users/.

Hope that helps,
Ben

In reply to Stefan
Avatar
Stefan

Thanks for your answer, now this working good.

In reply to Ben
Avatar
Jaclyn

I agree! I like the project & am learning how routing works but there are some roadblocks that might not be necessary for the learning to keep moving forward.

The comment was 7 months ago so I'll just reiterate... I am constantly having to go to the github repo to see what functions were being built or refactored. It's a good practice in reading the code and seeing what's happening when but a detriment in following the video. WRiting the code with you in the video is not sufficient because there are gaps in what is being built and what is shown. A short heads up on 'so I built this getUser function to fix this problem' would be super helpful. Same thing with the users photos - I didn't clone the repo for this lesson down because I wanted to start from scratch to learn so it would be helpful to have a heads up and say, 'hey, get a collection of photos that you want to use so you can learn to display photos with your user'

In reply to Martin
Avatar
Joel

The packaged version of nodemon in the repo only watches js by default, but I ran a more recent nodemon (because didn't clone the repo) where nodemon watches .json as well by default, so I had the same issue as Stefan reported of nodemon restarting when .json files where modified or removed.

The workaround nodemon index.js --ignore users/ didn't work for me though, nodemon seems to want the --watch flag to watch a file, so: nodemon --watch index.js. Or nodemon --ignore users/ or nodemon --ignore .json would work as well.

In reply to Ben
Avatar
George Katsanos

Exactly what Jaclyn said. I admit I am rather disappointed as the cost of the yearly subscription is rather high compared to other online courses (codeschool) which are much more paced and allow following the course without having to pause/copy code from github/resume..
For example, where's the explanation about require('path') ? .. Any mention about the saveUser() function?
If I wanted to copy/paste code I wouldn't buy an online video learning subscription. :(

In reply to Jaclyn
Avatar

Agreed. Steps being skipped over is very irritating.

In reply to George Katsanos
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?