My question is I need to run two different files on startup.
"scripts": {
"start": "node index.js" && "index.html"
},
^ This is a general idea of what I want to accomplish.
I need to run a file called index.js, and a file called index.html in the same project, at the same time.
I don’t know if it is possible or not.
index.js is a discord bot, and index.html is a website with basic text.
You could add express to your Discord bot. Also, you can’t run .HTML files in the console. You could serve them with express, like previously stated.
3 Likes
I’m quite the noob at this stuff, if you could provide some examples or how you would go about doing it, that would be absolutely perfect!
Thanks again.
// Put Discord Bot code here below the comments.
// Index.html file stuff below(Don't touch unless you read the docs! You could keep the bot from running!)
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.sendFile(__dirname +'/index.html')
})
app.listen(port, () => {
console.log(`The app is running at ${port}!`)
})
2 Likes