This commit is contained in:
2024-11-12 13:32:53 +07:00
commit 399a87e9d2
68 changed files with 23324 additions and 0 deletions

21
assets/js/server.js Normal file
View File

@@ -0,0 +1,21 @@
// server.js
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express();
const port = 5500;
app.use(cors()); // Cho phép CORS
app.use(bodyParser.json()); // Middleware để phân tích JSON
// Endpoint để nhận yêu cầu POST
app.post('/submit-bid', (req, res) => {
console.log(req.body); // In ra thông tin đã gửi
// Xử lý thông tin ở đây (lưu vào DB hoặc làm gì đó)
res.status(200).json({ message: 'Bid received', data: req.body });
});
// Khởi động server
app.listen(port, () => {
console.log(`Server is running at 192.168.1.71:${port}`);
});