2020-01-12 21:28:28 -05:00
|
|
|
`//etc/systemd/system/filename.service`
|
|
|
|
|
|
|
|
```
|
|
|
|
[Unit]
|
|
|
|
Description=forecast_api
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStart=/usr/bin/node //opt/forecast_api/index.js
|
|
|
|
Restart=always
|
|
|
|
User=fc_api
|
|
|
|
Environemnt=NODE_ENV=production
|
|
|
|
WorkingDirectory=//opt/forecast_api
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
```
|
|
|
|
|
|
|
|
`systemctl enable forecast.api`
|
|
|
|
|
2019-04-30 17:49:02 -04:00
|
|
|
`systemctl start forecast_api.service`
|