The Complete Guide To Building A REST API With Node, Express, TypeScript & MongoDB

This is a repository for a REST API tutorial using Node, Express, Typescript & MongoDB.

Features:

  • Environment, Typescript, Nodemon setup
  • MongoDB & Mongoose connect, Database creation
  • Controllers creation
  • Middlewares creation
  • Cookie based authentication
  • Postman testing
  • Create, Read, Update

Prerequisites

Node version 14.x

Install packages

npm i

Setup MongoDB URL

In src/index.ts:

const MONGO_URL = ""; // DB URI

Start the app

npm run dev

Available commands

Running commands with npm npm run [command]

command description
dev Starts a development instance of the app