sudo nano /lib/systemd/system/kogas-api.service
Add the service code below.
[Unit]
Description=Kogas JAVA API
[Service]
Environment=PORT=3000
Environment=GO_ENV=production
Type=simple
Restart=always
RestartSec=5s
WorkingDirectory=/opt/prod
ExecStart=/bin/java -Xms128m -Xmx256m -jar /path/to/your/file.jar
[Install]
WantedBy=multi-user.target
sudo service kogas-api start
sudo service kogas-api status