Services
Endpoints for deploying, managing, and monitoring PM2 services.
GET
/services/list-services
Lists all configured services on the server.
GET /services/list-services
GET
/services/pm2-list
Returns the full PM2 process list as JSON.
GET /services/pm2-list
GET
/services/status/:service
Returns the PM2 status for a single service.
GET /services/status/my-app
| Param | In | Required | Description |
|---|---|---|---|
service | path | Yes | PM2 process name |
POST
/services/deploy/:service
Pulls the latest code and restarts the service.
POST /services/deploy/my-app
| Param | In | Required | Description |
|---|---|---|---|
service | path | Yes | PM2 service / app name |
POST
/services/setup/:service
Runs the full setup script for a service. Pass optional extra arguments in the request body.
POST /services/setup/my-app
Content-Type: application/json
{ "args": ["--flag", "value"] }
| Param | In | Required | Description |
|---|---|---|---|
service | path | Yes | PM2 service / app name |
args | body / query (space-separated string) | No | Additional arguments forwarded to the setup script |
POST
/services/restart/:service
Restarts a PM2 process by name.
POST /services/restart/my-app
POST
/services/watch
Triggers the watch-service script to restart services on file changes.
POST /services/watch
POST
/services/logs/:service
Returns recent PM2 logs for a service.
POST /services/logs/my-app?lines=100
| Param | In | Required | Description |
|---|---|---|---|
service | path | Yes | PM2 process name |
lines | body / query | No | Number of log lines to return (default 200) |
POST
/services/snapshot/:service
Creates a snapshot of the current deployment for the service.
POST /services/snapshot/my-app
POST
/services/rollback/:service
Rolls the service back to its last snapshot.
POST /services/rollback/my-app
POST
/services/add-domain/:service
Adds a domain to the nginx configuration for the service.
POST /services/add-domain/my-app
Content-Type: application/json
{ "domain": "example.com" }
| Param | In | Required | Description |
|---|---|---|---|
service | path | Yes | PM2 service / app name |
domain | body / query | Yes | Domain name to register |