rpc-websockets icon indicating copy to clipboard operation
rpc-websockets copied to clipboard

Rpc-websockets on heroku

Open mojitoo opened this issue 4 years ago • 0 comments

After i deployed my app on heroku i had an issue, if you can help me please


const app = express()
const port = process.env.PORT || 8080 // Heroku will need the PORT environment variable

app.use(express.static(path.join(__dirname, 'build')));
app.get('/*', function (req, res) {
  res.sendFile(path.join(__dirname, 'build', 'index.html'));
});

app.listen(port, () => console.log(`App is live on port ${port}!`))

// instantiate Server and start listening for requests

var server = new WebSocketServer({
  port: port,
  host: anaddress
})

how can i please pass the express server (as a param) to the websocket server?

Thank you

mojitoo avatar Jul 12 '21 11:07 mojitoo