Running react and flask using a single shell script

Viewed 566

I have built an application that uses a ReactJS as frontend and Flask as middleware. I'm able to execute it using the following sequence of commands.

npm start
cd Equation-Solver
python -m flask run

After executing the first command, I have to open another terminal window and execute the next 2 commands. I would like to execute them together using a single shell script. Any help would be really appreciated.

1 Answers

Create a shell script. Add an ampersand at the end of the npm start line. This backgrounds that process. The other commands will then run. In this case the react app will show on the terminal, but the python app will be running also.

npm start &
cd Equation-Solver
python3 -m flask run
Related