Spaces:
Sleeping
Sleeping
Rename Index.js to index.js
Browse files- Index.js → index.js +0 -5
Index.js → index.js
RENAMED
|
@@ -14,7 +14,6 @@ app.post('/getlink', async (req, res) => {
|
|
| 14 |
}
|
| 15 |
|
| 16 |
try {
|
| 17 |
-
// We use a real User-Agent to stay hidden from bot detection
|
| 18 |
const response = await axios.post('https://www.terabox.com/api/getlink', {
|
| 19 |
url: url
|
| 20 |
}, {
|
|
@@ -25,11 +24,8 @@ app.post('/getlink', async (req, res) => {
|
|
| 25 |
'Accept': 'application/json'
|
| 26 |
}
|
| 27 |
});
|
| 28 |
-
|
| 29 |
-
console.log("Success: Link generated");
|
| 30 |
res.json(response.data);
|
| 31 |
} catch (error) {
|
| 32 |
-
console.error("Error from Terabox:", error.response ? error.response.status : error.message);
|
| 33 |
res.status(error.response ? error.response.status : 500).json({
|
| 34 |
error: "Proxy Error",
|
| 35 |
message: error.message
|
|
@@ -37,7 +33,6 @@ app.post('/getlink', async (req, res) => {
|
|
| 37 |
}
|
| 38 |
});
|
| 39 |
|
| 40 |
-
// Root path for health checks (UptimeRobot)
|
| 41 |
app.get('/', (req, res) => {
|
| 42 |
res.send("Terabox Proxy is Running!");
|
| 43 |
});
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
try {
|
|
|
|
| 17 |
const response = await axios.post('https://www.terabox.com/api/getlink', {
|
| 18 |
url: url
|
| 19 |
}, {
|
|
|
|
| 24 |
'Accept': 'application/json'
|
| 25 |
}
|
| 26 |
});
|
|
|
|
|
|
|
| 27 |
res.json(response.data);
|
| 28 |
} catch (error) {
|
|
|
|
| 29 |
res.status(error.response ? error.response.status : 500).json({
|
| 30 |
error: "Proxy Error",
|
| 31 |
message: error.message
|
|
|
|
| 33 |
}
|
| 34 |
});
|
| 35 |
|
|
|
|
| 36 |
app.get('/', (req, res) => {
|
| 37 |
res.send("Terabox Proxy is Running!");
|
| 38 |
});
|