Initial commit - express server, where citysys-terminal app is uploaded

This commit is contained in:
rasta5man 2024-04-15 19:46:51 +02:00
commit c4065c3f9c
9 changed files with 1623 additions and 0 deletions

54
README-HOW-TO-DEPLOY.txt Normal file
View file

@ -0,0 +1,54 @@
cd terminal
if node js is running - kill process
ss -lntup
kill pid
kill -9 pid // force kill
unzip terminal.zip -d destination_folder
alebo
python pyunzip.py terminal.zip
alebo python pyunzip.py node_modules.zip
----
create service
expres.service
----------------
[Unit]
Description=ExpressJS Server Launcher
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=1
ExecStart=/root/.nvm/versions/node/v12.18.2/bin/node /root/terminal/index.js
WorkingDirectory = /root/terminal
[Install]
WantedBy=multi-user.target
---------------------
copy here: /etc/systemd/system/
---------------------
autostart express location je //etc/systemd/system
vytvorim novy subor “sudo nano expres.service”
whereis node zistim cestu k node
do ExecStart napisem cestu napr: “node homeuser/flowserver/index.js” mozno treba aj sudo
spravime ho spustitelnym s “sudo chmod +x expres.service”
aby sa sam spustal dam “sudo systemctl enable expres”
ked uz je nahodou enablenuty treba ho reloadnut s “sudo systemctl daemon-reload”
ked nejde, treba dat pod ExecStart “WorkingDirectory = cesta/na/flowserver”
“sudo reboot” alebo “sudo systemctl reboot”