This post describes how to create a REST API using Node, KOA and PostgreSQL. It’s intended for beginners but is based on best practice. Most articles for beginners will tell you to focus on understanding the basics and don’t worry about design practices. They are probably right but that’s just not how my mind works. You should have your development environment ready with Node, NPM and Git installed before starting. If you need help; look at my previous articles on setting up your web development environment and getting started with Git. All of the code is documented below but the complete application code is here https://github.com/infornite/n4nite-rest-api if you want to refer to it as you follow along.
Git is a free and open source version control system. What this basically means is that you can use Git to store your projects and their files and it will keep track of different versions and changes to the files for you. You can use Git to store and manage files locally on your PC but most likely you will want to use one of the free cloud services that allows you to store the files online. Storing the files online makes it easier to share your projects and it also serves as a way to back up your file in case your PC crashes.
I just completed a clean install on one of my PC’s. I am using Windows 10 and I need to set up my windows development environment. I thought to document the steps for anyone that is starting out in web development.