port support

This commit is contained in:
Kevin Jahns
2018-11-25 23:41:17 +01:00
parent c12d00b227
commit f572f94586
6 changed files with 10 additions and 12 deletions

View File

@@ -5,7 +5,9 @@
import * as Y from '../../index.mjs'
import WebSocket from 'ws'
const wss = new WebSocket.Server({ port: 1234 })
const port = process.env.PORT || 1234
const wss = new WebSocket.Server({ port })
const docs = new Map()
const messageSync = 0
@@ -104,3 +106,5 @@ const setupConnection = (conn, req) => {
}
wss.on('connection', setupConnection)
console.log('running on port', port)