1

I am deploying a react front end app to interact with an API that is controlling a 15 X 3 Video Wall (This is an array of displays). The app will be running on a NUC (Windows 10) in a local, isolated network in the localhost. I want to set either a scheduled task when windows startup (in case of power failure) or create a service that runs my npm start. I have tried some variants but none work. How can I do this?

I have tried qckwinsvc which runs a .js file but I can not figure out how to actually tell to run the start script in my package.json

Ernesto
  • 173
  • 1
  • 2
  • 11

2 Answers2

1

what about a cronjob that check if the server is running every certain amount of time, if the server is not running you can use shelljs to execute and start you localhost server or npm start

https://www.npmjs.com/package/node-schedule

ncubica
  • 8,169
  • 9
  • 54
  • 72
  • mmmm... I like your suggestion more than my solution which will work only on windows startup. Thanks, I will test out but at least I saved the day for now with the windows scheduler. Thank you. – Ernesto Nov 03 '19 at 04:57
1

I got it sorted out.

create a .bat file inside your /src folder with this

start cmd.exe /k "call npm start" pause

and then set the schedule on startup with these instructions.

Batch File runs manually but not in task scheduler

Ernesto
  • 173
  • 1
  • 2
  • 11