Skip to content

Commit

Permalink
Merge pull request #15 from the-hideout/reduce-console-spam
Browse files Browse the repository at this point in the history
Convert to .mjs, remove debugging output
  • Loading branch information
Razzmatazzz authored May 17, 2024
2 parents 2757e27 + fad06e1 commit 175aec7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "tarkov-socket-server",
"version": "1.0.0",
"version": "2.0.0",
"description": "",
"main": "server.js",
"main": "server.mjs",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js",
"dev": "nodemon server.js"
"start": "node server.mjs",
"dev": "nodemon server.mjs"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kokarn/tarkov-socket-server.git"
"url": "git+https://github.com/the-hideout/tarkov-socket-server.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/kokarn/tarkov-socket-server/issues"
"url": "https://github.com/the-hideout/tarkov-socket-server/issues"
},
"homepage": "https://github.com/kokarn/tarkov-socket-server#readme",
"homepage": "https://github.com/the-hideout/tarkov-socket-server#readme",
"dependencies": {
"ws": "^8.17.0",
"dotenv": "^16.4.5"
Expand Down
10 changes: 6 additions & 4 deletions server.js → server.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require('dotenv').config();
const WebSocket = require('ws');
import dotenv from 'dotenv';
import WebSocket, { WebSocketServer } from 'ws';

const wss = new WebSocket.Server({
dotenv.config();

const wss = new WebSocketServer({
port: process.env.PORT || 8080,
});

Expand Down Expand Up @@ -39,7 +41,7 @@ wss.on('connection', (ws, req) => {
ws.sessionID = url.searchParams.get('sessionid');

if (!ws.sessionID) {
console.log('Terminating connecting client missing sessionID');
//console.log('Terminating connecting client missing sessionID');
ws.terminate();
return;
}
Expand Down

0 comments on commit 175aec7

Please sign in to comment.