Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
bdougie authored Apr 10, 2021
1 parent e15fddd commit 6c88162
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit 6c88162

Please sign in to comment.