Running Applications ​
Launchpad's monitoring system helps you manage and maintain long-running applications reliably. This guide covers how to configure, launch, and monitor your applications using Launchpad.
Overview ​
The monitoring system is built on top of PM2, a robust process manager, providing:
- Process management and auto-restart
- Log collection and rotation
- Application status monitoring
- Graceful shutdown handling
Basic Setup ​
- Install the required packages:
bash
npm install @bluecadet/launchpad-cli @bluecadet/launchpad-monitor
- Configure your applications in
launchpad.config.js
:
js
import { defineConfig } from '@bluecadet/launchpad-cli';
export default defineConfig({
monitor: {
apps: [
{
pm2: {
name: "my-app",
script: "./app.exe",
cwd: "./builds/",
// Optional: environment variables
env: {
PORT: "3000"
}
}
}
]
}
});
WARNING
Always test your configuration in a development environment first
- Start your application
bash
npx launchpad monitor start
Configuration Options ​
Basic Settings ​
name
: Unique identifier for your applicationscript
: Path to your executable or scriptcwd
: Working directory for your application
Advanced Settings ​
js
{
pm2: {
// Process settings
autorestart: true,
// Resource limits
max_memory_restart: '1G',
// Environment
env: {
NODE_ENV: 'production'
}
}
}
Best Practices ​
- Unique Names: Give each application a unique, descriptive name
- Error Handling: Configure proper restart policies
- Resource Limits: Set memory limits to prevent system overload
- Logging: Use appropriate log levels for debugging
Next Steps ​
- Learn about content management
- Read the monitor reference for detailed API documentation