From 70651933c49d0d6c8b95acd625703c3c35cdf4d8 Mon Sep 17 00:00:00 2001 From: venu123143 Date: Sun, 22 Feb 2026 12:18:56 +0530 Subject: [PATCH 1/3] commented the with ip code --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index bc0d0d9..b800d7b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,10 +6,12 @@ import config from "@/config/config"; const app = new App(); const socketEngine = app.getSocketEngine(); const port = config.PORT || 3000; +const hostname = "0.0.0.0"; // Use IP from env or default to 0.0.0.0 (all interfaces) // Start Bun server Bun.serve({ port, + // hostname, idleTimeout: 30, websocket: socketEngine.handler().websocket, // <-- attach WebSocket handler async fetch(req, server) { @@ -36,4 +38,6 @@ Bun.serve({ : {}), }); -console.log(`🚀 Server running on http${config.HTTP2.SSL.ENABLED ? "s" : ""}://localhost:${port}`); +const protocol = config.HTTP2.SSL.ENABLED ? "https" : "http"; +const displayHost = hostname === "0.0.0.0" ? "localhost" : hostname; +console.log(`🚀 Server running on ${protocol}://${displayHost}:${port}`); From 8b7a9052533f0aad0a2eb8b3db4b9d63cad5e360 Mon Sep 17 00:00:00 2001 From: venu123143 Date: Sat, 7 Mar 2026 14:33:41 +0530 Subject: [PATCH 2/3] edn url changes --- src/config/config.ts | 2 ++ src/config/s3.config.ts | 2 +- src/index.ts | 4 ++-- src/utils/cors-options.ts | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config/config.ts b/src/config/config.ts index 33ace71..a9f59f0 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -38,6 +38,7 @@ interface Config { ENDPOINT: string; BUCKET_NAME: string; REGION: string; + CDN_URL: string; }; CLOUDFLARE: { CDN_DOMAIN: string; @@ -78,6 +79,7 @@ const config: Config = { ENDPOINT: process.env.S3_ENDPOINT!, BUCKET_NAME: process.env.S3_BUCKET_NAME!, REGION: process.env.S3_REGION!, + CDN_URL: process.env.S3_CDN_URL!, }, CLOUDFLARE: { CDN_DOMAIN: process.env.CLOUDFLARE_CDN_DOMAIN!, diff --git a/src/config/s3.config.ts b/src/config/s3.config.ts index 57e2e9b..f5dd3cb 100644 --- a/src/config/s3.config.ts +++ b/src/config/s3.config.ts @@ -53,7 +53,7 @@ export class S3Service { } public buildCDNUrl(key: string): string { - return `https://fileflow.fsn1.your-objectstorage.com/${key}`; + return `${config.S3.CDN_URL}/${key}`; } /** diff --git a/src/index.ts b/src/index.ts index b800d7b..346e02b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,12 +6,12 @@ import config from "@/config/config"; const app = new App(); const socketEngine = app.getSocketEngine(); const port = config.PORT || 3000; -const hostname = "0.0.0.0"; // Use IP from env or default to 0.0.0.0 (all interfaces) +const hostname = process.env.IP || "0.0.0.0"; // Use IP from env or default to 0.0.0.0 (all interfaces) // Start Bun server Bun.serve({ port, - // hostname, + hostname, idleTimeout: 30, websocket: socketEngine.handler().websocket, // <-- attach WebSocket handler async fetch(req, server) { diff --git a/src/utils/cors-options.ts b/src/utils/cors-options.ts index 594abbf..29a31ab 100644 --- a/src/utils/cors-options.ts +++ b/src/utils/cors-options.ts @@ -8,7 +8,8 @@ export const corsOptions = { "http://localhost:3001", "http://localhost:5000", "http://localhost:5173", - "https://fileflow.nerchuko.in" + "https://fileflow.nerchuko.in", + "http://192.168.0.8:5173", ], credentials: true, exposedHeaders: ["sessionid", "logintoken", "resettoken", "ratelimit-remaining"], From 9bdf81943131a9c7f397190adcdb929c5b17f37a Mon Sep 17 00:00:00 2001 From: venu123143 Date: Sat, 7 Mar 2026 14:50:28 +0530 Subject: [PATCH 3/3] code changes --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 346e02b..b800d7b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,12 +6,12 @@ import config from "@/config/config"; const app = new App(); const socketEngine = app.getSocketEngine(); const port = config.PORT || 3000; -const hostname = process.env.IP || "0.0.0.0"; // Use IP from env or default to 0.0.0.0 (all interfaces) +const hostname = "0.0.0.0"; // Use IP from env or default to 0.0.0.0 (all interfaces) // Start Bun server Bun.serve({ port, - hostname, + // hostname, idleTimeout: 30, websocket: socketEngine.handler().websocket, // <-- attach WebSocket handler async fetch(req, server) {