How To Build a REST API With Nodejs and PostgreSQL

Create a REST API using Node.js as the back-end server with help from ExpressJS framework and Sequelize, and connect it with a PostgreSQL database.

Aman Mittal
Dec 10, 2018 · 11 min read
Image for post
Image for post

Prerequisites

Installing PostgreSQL

Image for post
Image for post

Getting Started

Image for post
Image for post

Setting up Sequelize

Image for post
Image for post
Image for post
Image for post

Making Database Connection

Creating the Database Model

Image for post
Image for post

Creating the Database Relationship

Running the Migrations

Image for post
Image for post

Building the API

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

API for Todo Items

Image for post
Image for post
Image for post
Image for post

Deleting Todo Lists

Image for post
Image for post
Image for post
Image for post

Conclusion


Crowdbotics

The fastest way to build your next app.

Aman Mittal

Written by

👨‍💻Developer 👉 Nodejs, Reactjs, ReactNative | Tech Blogger with 1M+ views at Medium| My weekly dev newsletter 👉 tinyletter.com/amanhimself

Crowdbotics

The fastest way to build your next app.

Aman Mittal

Written by

👨‍💻Developer 👉 Nodejs, Reactjs, ReactNative | Tech Blogger with 1M+ views at Medium| My weekly dev newsletter 👉 tinyletter.com/amanhimself

Crowdbotics

The fastest way to build your next app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store