service file
This commit is contained in:
parent
af10384cb7
commit
0729e559a3
18
smartclient.service
Normal file
18
smartclient.service
Normal file
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=smartclient
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
GuessMainPID=yes
|
||||
ExecStart=/usr/bin/npm run server
|
||||
ExecStop=kill -SIGINT $mainpid
|
||||
Restart=on-failure
|
||||
WorkingDirectory=/opt/services/smartclient
|
||||
|
||||
[Install]
|
||||
Alias=smartclient
|
||||
WantedBy=multi-user.target
|
||||
|
@ -9,7 +9,7 @@ export class MqttclientService {
|
||||
private callbacks : Map<string, callbackFunc> = new Map()
|
||||
|
||||
constructor() {
|
||||
this.mqttClient = Mqtt.connect('ws://127.0.0.1:9001')
|
||||
this.mqttClient = Mqtt.connect('ws://172.16.2.16:9001')
|
||||
this.mqttClient.on('connect', () => {
|
||||
console.log('MQTT connected')
|
||||
this.callbacks.forEach((value: callbackFunc, key: string) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user