A simple starter for a Node.js server with TypeScript, Express, Mongoose, RxJS, Moment and TypeScript REST, enables hot reload with debug support for VSCode
ts-node-dev is used to run the server with hot reload so the project restarts every time we edit and save a file.
ts-node-dev allows us also to attach a debugger, VSCode is used for debugging and an initial configuration is provided inside .vscode/launch.json
In order to debug follow the following steps:
- Clone this repo.
- Run npm install in project folder.
- Run npm run dev in project folder.
- Navigate to Debug view in VSCode.
- Run Attach Typescript Server debug configuration to attach the debugger to the running node process.
There are multiple libraries added that i use in almost all my node projects.
This repo uses the following libraires:
- Express: Fast, unopinionated, minimalist web framework for Node.js.
- Typescript REST: Lightweight annotation-based Express.js extension for Typescript.
- Moment: Parse, validate, manipulate, and display dates and times in JavaScript.
- Lodash: A modern JavaScript utility library delivering modularity, performance & extras.
- RxJS: A library for reactive programming using Observables, to make it easier to compose asynchronous or callback-based code.
- Mongoose: Elegant mongodb object modeling for Node.js.