How do I make 2 scripts run on start up?

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?

1 Like

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:

6 Likes

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

2 Likes

Glad I could be of assistance!

Happy Glitching! :slight_smile:

3 Likes

how to run java lavalink and server.js at the same time

You cannot run Lavalink on Glitch since glitch uses a different version of JDA which Lavalink does not support.

1 Like

Also, lavalink uses java and I don’t think you could combine .java and .js files.