Update server.js
Browse files
server.js
CHANGED
@@ -6,7 +6,7 @@ const https = require("https");
|
|
6 |
|
7 |
const app = express();
|
8 |
const PORT = 7860;
|
9 |
-
const HOST_URL = "https://your-domain.com"; // 🔹
|
10 |
const DOWNLOAD_DIR = path.join(__dirname, "downloads");
|
11 |
|
12 |
// Ensure the downloads directory exists
|
@@ -14,9 +14,6 @@ if (!fs.existsSync(DOWNLOAD_DIR)) {
|
|
14 |
fs.mkdirSync(DOWNLOAD_DIR, { recursive: true });
|
15 |
}
|
16 |
|
17 |
-
// Set correct permissions for the downloads directory
|
18 |
-
fs.chmodSync(DOWNLOAD_DIR, 0o777); // 🔹 Allows read/write access
|
19 |
-
|
20 |
// Axios instance to ignore SSL certificate verification
|
21 |
const axiosInstance = axios.create({
|
22 |
httpsAgent: new https.Agent({ rejectUnauthorized: false })
|
|
|
6 |
|
7 |
const app = express();
|
8 |
const PORT = 7860;
|
9 |
+
const HOST_URL = "https://your-domain.com"; // 🔹 Replace with your actual domain
|
10 |
const DOWNLOAD_DIR = path.join(__dirname, "downloads");
|
11 |
|
12 |
// Ensure the downloads directory exists
|
|
|
14 |
fs.mkdirSync(DOWNLOAD_DIR, { recursive: true });
|
15 |
}
|
16 |
|
|
|
|
|
|
|
17 |
// Axios instance to ignore SSL certificate verification
|
18 |
const axiosInstance = axios.create({
|
19 |
httpsAgent: new https.Agent({ rejectUnauthorized: false })
|