So I have an npm package that uses app.listen(port)
and I have an app.listen(port)
in my own file too. Now since this results in trying to listen to the same port twice, it throws the error Error: listen EADDRINUSE :::3000
. Removing the listening from the module won’t make that webpage appear. How would I go around this? I can edit the package if that is needed.
const app = require('express')()
app.get("/", function(request, response) {
response.sendFile(__dirname + '/homepage.html')
})
db.createWebview('1234', process.env.PORT, 'db') // Listens too
app.listen(process.env.PORT) // Listens again
Removing one of the listens will make the other file (html) work.
Sorry if this is confusing
Regards.