Node.js Postgresql tutorial: Build a simple REST API with Express
A step-by-step guide from start to finish
Published in
8 min readJan 14, 2021
Node.js can be used efficiently with relational databases like PostgreSQL. In this post about Node.js PostgreSQL tutorial, we are going to build a REST API for Quotes step-by-step using Express Js.
You can read my previous tutorial to try Node.js with MySQL. You should read this guide to use Docker with Node.js, it is also a step-by-step guide. You can, of course, carry on with this Node.js with PostgreSQL tutorial :).
For your convinience, each step has been carved out as a distinct pull reqeust so that you can follow the tutorial with ease.
Prerequisites
- You have Node.js (preferably Node 14.x) installed and running on your machine (or Node.js running with a docker container).
- You are aware of how Node.js generally works and also have a bit of Express Js experience.
- Having some knowledge of Git and GitHub will be really useful.
- For the database we will use a free database on ElephantSQL, so please register and set up a free PostgreSQL database there. Of course, you should know how a relational database works.
- You are able to code using an IDE. I will be…