diff --git a/server/index.js b/server/index.js index fcc60eb..3d4128d 100644 --- a/server/index.js +++ b/server/index.js @@ -1,7 +1,6 @@ require('dotenv').config() const WebSocket = require('ws'); const express = require('express'); -const PORT = process.env.PORT | 8080; // install with: npm install @octokit/webhooks const { Webhooks } = require("@octokit/webhooks"); @@ -40,7 +39,9 @@ app.use(express.static('public')) app.use(webhooks.middleware) //initialize the server to be used by the websockets -const server = app.listen(PORT, () => console.log('Server started on port')) +app.set('port', process.env.PORT || 3000); +const server = app.listen(app.get('port'), () => console.log('Server started on port')) + //add the WebSocket to the server const wss = new WebSocket.Server({ server });