Raybilhelp commited on
Commit
5d5981a
·
verified ·
1 Parent(s): 5b30830

Rename main.py to index.js

Browse files
Files changed (2) hide show
  1. index.js +23 -0
  2. main.py +0 -17
index.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const express = require('express');
2
+ const app = express();
3
+ const PORT = 7860;
4
+
5
+ app.get('/', (req, res) => {
6
+ res.send({ message: "Turbo Tempest Reward Server is Running (Node.js)!" });
7
+ });
8
+
9
+ app.get('/reward', (req, res) => {
10
+ const userId = req.query.userid;
11
+
12
+ if (userId) {
13
+ console.log(`User ${userId} earned a reward!`);
14
+ // এখানে পরে আমরা Supabase/Appwrite SDK যুক্ত করব
15
+ return res.status(200).send("OK");
16
+ }
17
+
18
+ return res.status(400).send("No userid provided");
19
+ });
20
+
21
+ app.listen(PORT, () => {
22
+ console.log(`Server is running on port ${PORT}`);
23
+ });
main.py DELETED
@@ -1,17 +0,0 @@
1
- from fastapi import FastAPI, Request
2
-
3
- app = FastAPI()
4
-
5
- @app.get("/")
6
- def home():
7
- return {"message": "Reward Server is Running!"}
8
-
9
- @app.get("/reward")
10
- async def get_reward(request: Request):
11
- user_id = request.query_params.get('userid')
12
- if user_id:
13
- # এখানে পরে আমরা ডাটাবেস কোড লিখব
14
- print(f"User {user_id} earned a reward!")
15
- return "OK"
16
- return "Error", 400
17
-