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
ParamInRequiredDescription
servicepathYesPM2 process name
POST /services/deploy/:service

Pulls the latest code and restarts the service.

POST /services/deploy/my-app
ParamInRequiredDescription
servicepathYesPM2 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"] }
ParamInRequiredDescription
servicepathYesPM2 service / app name
argsbody / query (space-separated string)NoAdditional 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
ParamInRequiredDescription
servicepathYesPM2 process name
linesbody / queryNoNumber 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" }
ParamInRequiredDescription
servicepathYesPM2 service / app name
domainbody / queryYesDomain name to register