File size: 1,138 Bytes
2207e71
 
f2640f6
2207e71
e25b8bd
f2640f6
e25b8bd
2207e71
 
e25b8bd
f2640f6
 
e25b8bd
cf9df64
e25b8bd
 
cf9df64
2207e71
e25b8bd
 
2207e71
 
e25b8bd
cf9df64
e25b8bd
f2640f6
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
const express = require('express');
const app = express();
const PORT = 7860;

// ১. হোম রাউট (এটি থাকলে ড্যাশবোর্ড থেকে ক্লিক করলে আর ৪0৪ আসবে না)
app.get('/', (req, res) => {
    res.send("<h1>Server is Running!</h1><p>Adsgram Reward Server is Live.</p>");
});

// ২. Adsgram রিওয়ার্ড রাউট (যেটি আপনার আসল কাজের জন্য)
app.get('/reward', (req, res) => {
    const userId = req.query.userid;
    
    if (userId) {
        console.log(`Success: Reward signal received for User: ${userId}`);
        // এখানে পরে আমরা ডাটাবেস আপডেট করার কোড যোগ করব
        return res.status(200).send("OK");
    }
    
    return res.status(400).send("Error: No UserID provided");
});

// ৩. পোর্ট সেটিংস (Hugging Face এর জন্য এটি এভাবেই থাকতে হবে)
app.listen(PORT, '0.0.0.0', () => {
    console.log(`Server is listening on port ${PORT}`);
});