REST API with Node.js + Express.js + TypeScript

This sample demonstrates how to refactor the calculator API with MVC (Model View Controller) pattern and object-oriented programming. The refactored code uses Domain Object to represent business logic, Data Access Object (DAO) for data access, Data Mappers to convert between Domain Object and Data Transfer Object (DTO), and controller to coordinate workflows. The refactored code improves separation of concern and is more modular and maintainable.

Pre-requisites

Instructions

  1. Clone the repository with this branch.
git clone -b main <CLONE URL>
  1. Install dependencies.
npm install
  1. Run Express.js server.
# for Windows
npm run dev:win

# for Linux / macOS
npm run dev