How do I make 2 scripts run on start up?

#1

I’d like to have a web server start, as well as some JS for a TwitchBot.

As it stands, I can only run 1 script at a time.

“scripts”: {
“start”: “node bot.js && node server.js”
},

only runs bot.js, even though I want it to run both bot.js and server.js in parallel.

Any thoughts?

#2

Welcome @TechPhil,

In your bot.js file, can you put the following at the very top of the file!

require('/app/server.js')

and remove “&& node server.js” from your package.json and tell me if that helps at all! :slight_smile:

2 Likes
#3

That worked! Thanks so much! I was stuck for ages!

#4

Glad I could be of assistance!

Happy Glitching! :slight_smile:

2 Likes