Dirst attempt at the daemon
This commit is contained in:
parent
e38daf52de
commit
8fd169bc6c
|
@ -24,6 +24,12 @@ BASE_URL=http://localhost:3000 docker run -i -v $PWD/static:/opt/static headles
|
|||
BASE_URL=http://localhost:3000 node .
|
||||
```
|
||||
|
||||
To set up a systemd daemon that starts with the server, use:
|
||||
|
||||
```
|
||||
npm run install-daemon
|
||||
```
|
||||
|
||||
## Testing the API
|
||||
|
||||
with httpie:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"description": "## Dependencies",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"install-daemon": "cp screenshot-service.service /etc/systemd/system/ && systemctl start screenshot-service && systemctl enable screenshot-service"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
15
screenshot-service.service
Normal file
15
screenshot-service.service
Normal file
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=Service that takes screenshots for users of the Rentgen addon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=/root/ss
|
||||
ExecStart=node /root/ss
|
||||
Restart=on-failure
|
||||
RestartSec=1s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user