-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnode.js
More file actions
37 lines (31 loc) · 1.25 KB
/
Copy pathnode.js
File metadata and controls
37 lines (31 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const express = require('express');
const axios = require('axios');
const app = express();
app.get('/api/ban_check/:uid', async (req, res) => {
const { uid } = req.params;
const url = `https://ff.garena.com/api/antihack/check_banned?lang=en&uid=${uid}`;
const headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36',
'Accept': 'application/json, text/plain, */*',
'authority': 'ff.garena.com',
'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
'referer': 'https://ff.garena.com/en/support/',
'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'x-requested-with': 'B6FksShzIgjfrYImLpTsadjS86sddhFH',
};
try {
const response = await axios.get(url, { headers });
res.json(response.data);
} catch (error) {
res.status(500).json({ error: 'Internal Server Error' });
}
});
const PORT = process.env.PORT || 8000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});