rpc-websockets
rpc-websockets copied to clipboard
Rpc-websockets on heroku
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