Skip to content

Commit

Permalink
fixes EADDRINUSE while testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ksraj123 committed Jul 28, 2020
1 parent 4157431 commit 099f6cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ app.use(bodyParser.urlencoded(fileConstants.fileParameters))
const memoryStorage = multer.memoryStorage()
app.use(multer({ storage: memoryStorage }).single('file'))

server.listen(process.env.SOCKET_PORT || 8810)
if (process.env.NODE_ENV !== 'testing') {
server.listen(process.env.SOCKET_PORT || 8810)
}
// WARNING: app.listen(80) will NOT work here!

const io = socket.listen(server)
Expand Down

0 comments on commit 099f6cf

Please sign in to comment.