Production Setup Guide
🚀 Basic Setup
-
Build the project:
npm run build
-
Start in production mode:
npm run start
🔧 PM2 Configuration
Since TSDIAPI uses ESM modules, use this command to start with PM2:
pm2 start npm --name <app-name> -- run start
Example:
pm2 start npm --name my-api -- run start
⚙️ Environment Configuration
-
Create
.env
file in the project root:NODE_ENV=production
PORT=3000
# Add other environment variables -
Make sure all required environment variables are set in production.
📦 Additional PM2 Commands
# View logs
pm2 logs <app-name>
# Restart application
pm2 restart <app-name>
# Stop application
pm2 stop <app-name>
# Delete application
pm2 delete <app-name>