How do you auto start golang scripts in PM2 on Ubuntu 20.04? this is how I run golang scripts:
./rimgo
I tried pm2 start "./rimgo" --name rimgo
but it didn't work. What is the correct command?
you can follow this steps :
go build main.go
sudo chmod +x main
.package.json
file:{
"apps" : [{
"name" : "main",
"script" : "./main"
}]
}
and finally:
execute :
pm2 start package.json