on-server
Version:
Run shell commands in the browser
15 lines (12 loc) • 372 B
text/typescript
import { spawn } from "child_process";
console.log("Starting on-server with PM2");
const pm2Proc = spawn("pm2", ["start", "config/pm2.config.js"], {
shell: true,
});
pm2Proc.stdout.pipe(process.stdout);
pm2Proc.on("exit", (code) => {
console.log(
code == 0 ? "on-server started successfully" : "on-server failed to start"
);
});