-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (20 loc) · 676 Bytes
/
script.js
File metadata and controls
26 lines (20 loc) · 676 Bytes
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
const express = require('express');
const app = express();
const port = process.env.PORT || 3000;
// Serve static HTML files
app.use(express.static('public'));
// Parse JSON and form data
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// POST endpoint to handle code submission
app.post('/submitCode', (req, res) => {
const code = req.body.code;
// Here you can process the code or send it to your Telegram bot
console.log('Received code:', code);
// Respond to the client
res.status(200).json({ message: 'Code received' });
});
// Start the server
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});