I'm trying to have my raspberry pi start a python server with connected Vue.js frontend at startup.
Right now i'm using crontab with the following configuration:
@reboot sh /home/pi/Desktop/server-client/server/launcher.sh >> /home/pi/Desktop/server-client/server/logs/log.txt 2>&1 @reboot sh /home/pi/Desktop/server-client/client/launcher.sh >> /home/pi/Desktop/server-client/client/logs/log.txt 2>&1
launcher.shin the server folder is a simple
python3 app.py while the launcher in the client folder is
npm run dev
When i reboot the rpi only the server starts while the front end doesn't, i'm thinking that it may be because by running
python3 the rpi stays stuck running the server and doesn't start the
npm run dev process but i'm not sure (trying to avoid this is the reason i have 2 different @reboot instead of a single one and a unified launcher)
I have a flask server written in python with a vue.js frontend developed using npm. To start the server i use python3 app.py while t ostart the frontend i use npm run dev (this builds the frontend dependencies and serves it on a port). I wanted to start them both at startup so i set up a cron job, when i restart the rpi only the python3 command is executed but not the npm run dev one, i'm looking for a way to start them both automatically at startup (they work if i open 2 terminals and start them manually).
How can i make sure that both the python server and the Vue.js front end start when the rpi is rebooted?