Advanced Node.js Development
上QQ阅读APP看书,第一时间看更新

Making commit for POST /todos route

The last thing to do is make a commit. We added some meaningful code, so we're going to want to save that work. If I run git status, you can see we have a few changed files as well as some untracked ones, so I will use git add . to add all of those to the next commit. Now, I can use git commit with the -m flag to actually make the commit. A good commit message for this one would be Test POST /todos route:

git commit -m 'Test POST /todos route'

I'm going to make the commit, and lastly, I'll be pushing this up to GitHub using git push. You can use git push for this particular case. I need to go ahead and use git push --force, which is going to overwrite everything on GitHub. This is only something I need to do in this specific situation. You should just be running git push. Once you run that, your code should get pushed up to GitHub, and you are done. We have two test cases for our route, and it's time to move on and add a new route. The next route is going to be a GET request to fetch all Todos.