Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions bun.lock

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

7 changes: 2 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import dotenv from 'dotenv';
import { websocket } from './src/websocket';
import { ClientWSObject, type WebSocketData } from './src/types';
import terminateInstances from './src/routes/terminateInstances';
import getActiveInstances from './src/routes/getActiveInstances';

dotenv.config();

const PORT = parseInt(process.env.PORT || "3000");
const VERSION = parseFloat(process.env.VERSION || "1.8");
const PORT = parseInt(Bun.env.PORT || "3000");
const VERSION = parseFloat(Bun.env.VERSION || "1.8");

export const CONN_CLIENTS: Map<string, ClientWSObject> = new Map();

Expand Down
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"name": "devley-license-ws",
"module": "index.ts",
"type": "module",
"private": true,
"scripts": {
"start": "bun run index.ts",
"dev": "bun --hot run index.ts"
},
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"dotenv": "^16.5.0"
}
"private": true,
"scripts": {
"start": "bun run index.ts",
"dev": "bun --hot run index.ts"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UserObject } from './types.ts';

const DASHBOARD_URL = process.env.DASHBOARD_URL ?? "";
const DASHBOARD_URL = Bun.env.DASHBOARD_URL ?? "";

export async function checkAuthorization({ request }: { request: Request }) {
const authorization = request.headers.get('authorization') || "";
Expand Down
4 changes: 2 additions & 2 deletions src/websocket.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CONN_CLIENTS } from '../index';
import { LicenseObject, ProductObject, ClientWSObject } from './types';

const DASHBOARD_URL = process.env.DASHBOARD_URL || '';
const MAX_CONNECTIONS = parseInt(process.env.MAX_CONNECTIONS || "10000");
const DASHBOARD_URL = Bun.env.DASHBOARD_URL || '';
const MAX_CONNECTIONS = parseInt(Bun.env.MAX_CONNECTIONS || "10000");

export const websocket = {
async open(ws: WebSocket, product_slug: string, product_version: number, license_key: string) {
Expand Down