Skip to content

REST API with Node.js, Express, TypeScript, MongoDB & Zod

Notifications You must be signed in to change notification settings

Ismail-butt/rest-api

Repository files navigation

Rest-Api using Express, Jest, Prometheus and Swagger Docs

REST API Build with Node.js, Express, TypeScript, MongoDB & Zod

Testing Express REST API With Jest & Supertest

Measure your ExpressJS API Performance with Prometheus

Automatically Generate Swagger Docs With ExpressJS & NodeJS

rest-api

Routes

User Resource

  • Create User
  • Create Session
  • Get Sessions
  • Delete Session

Product Resource

  • Create Product
  • Get Product
  • Update Product
  • Delete Product

Metrics

  • Get metrics

Usage

Env Variables

Create a .env file in the root and add the following

PRIVATE_KEY = your private jwt key
DB_CONNECTION = your mongodb uri

Install Dependencies

npm install

Run

# Run rest api(backend), swagger docs and metrics server
npm run dev

Running tests

It uses Jest & Supertest for Testing Express REST API

# Run rest-api tests only
npm run test

Happy Coding :)

Releases

No releases published

Languages