forked from swapnil.bendal/TypeScript-Backend-Template
8eee93c6a790eb5c056fbc46b7fe8ea5703df33b
TypeScript Backend Template
Table of Contents
Installation
Prerequisites
Steps
- Fork the repository to your GitHub or GitLab account.
- Clone your forked repository:
git clone https://<your-git-account>/TypeScript-Backend-Template.git - Navigate to the project directory:
cd TypeScript-Backend-Template - Install dependencies:
npm install
Usage
Development Mode
- Start the development server:
npm run dev - Open your browser and navigate to:
http://localhost:3000
Production Mode
- Install PM2 globally for process management:
npm install pm2 -g - Start the production server:
npm start
Environment Variables
Create a .env file in the root directory based on the structure of .env.example.
Scripts
| Script | Description |
|---|---|
npm start |
Starts the app in production mode using PM2. |
npm run dev |
Starts the app in development mode with nodemon. |
npm run test |
Starts the app in test mode with nodemon. |
npm run lint |
Runs ESLint to check for code quality issues. |
npm run lint:fix |
Fixes fixable issues detected by ESLint. |
npm run prettier |
Checks code formatting using Prettier. |
npm run prettier:fix |
Formats code files according to Prettier rules. |
npm run prepare |
Prepares Husky for managing Git hooks. |
License
This project is licensed under the MIT License.
Description
Languages
TypeScript
99.1%
JavaScript
0.9%