From the course: JavaScript Code Challenges: Creating Web Apps

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Final touches

Final touches

- [Instructor] All right, our application tracker is working, but it has some room for improvement, so let's clean it up. Let's start in server.js. It's quite all right, but there are some things I would like to see improved. First of all, I want some error handling on my readJobs, like this. And I can actually do the same thing for the writeJobs. I can add error handling to this too. For now, copy this. And then on here, just going to say error writing jobs file. Okay, so we have some error handling in place. Other things we could include would be some validation in the post, for example. And also, using the Date.now for an id is not recommended in production, but I'll leave it for now. Let's go ahead and make some improvements to our frontend. So first of all, you would want to wrap the fetch in a try-catch, so let's go ahead and change that. So staying mostly the same, just adding a little bit of error handling and a message for displaying that we could not load jobs if that…

Contents