 cat ecosystem.config.cjs
module.exports = {
  apps: [{
    name: 'vigilanza-turni',
    script: 'npm',
    args: 'start',
    env: {
      NODE_ENV: 'production',
      PORT: 5000,
      DATABASE_URL: 'postgresql://vigilanza_user:X8rWvmmeHbsUiKgSNr6dVOPBo@localhost:5432/vigilanza_turni?sslmode=disable',
      DOMAIN: 'vt.alfacom.it',
      SESSION_SECRET: 'abbaialacanadellacanna',
      ISSUER_URL: 'https://replit.com/oidc'
    }
  }]
};
[root@localhost vigilanza-turni]# pm2 delete vigilanza-turni
[PM2] Applying action deleteProcessId on app [vigilanza-turni](ids: [ 0 ])
[PM2] [vigilanza-turni](0) ✓
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
[root@localhost vigilanza-turni]# pm2 start ecosystem.config.cjs
[PM2][WARN] Applications vigilanza-turni not running, starting...
[PM2] App [vigilanza-turni] launched (1 instances)
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 0  │ vigilanza-turni    │ fork     │ 0    │ online    │ 0%       │ 6.4mb    │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
[root@localhost vigilanza-turni]# pm2 save
[PM2] Saving current process list...
[PM2] Successfully saved in /root/.pm2/dump.pm2
[root@localhost vigilanza-turni]# curl https://vt.alfacom.it/api/auto-login-admin
{"error":"Errore server","message":"Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:vt.alfacom.it"}[root@localhost vigilanza-turni]# cat .env
DATABASE_URL=postgresql://vigilanza_user:X8rWvmmeHbsUiKgSNr6dVOPBo@localhost:5432/vigilanza_turni?sslmode=disable
PGDATABASE=vigilanza_turni
PGUSER=vigilanza_user
PGPASSWORD=X8rWvmmeHbsUiKgSNr6dVOPBo
PGHOST=localhost
PGPORT=5432
SESSION_SECRET=abbaialacanadellacanna
NODE_ENV=production
PORT=5000
DOMAIN=vt.alfacom.it
ISSUER_URL=https://replit.com/oidc