17 lines
475 B
JavaScript
17 lines
475 B
JavaScript
const express = require("express");
|
|
const app = express();
|
|
|
|
app.use(express.json()); // Middleware to parse JSON bodies
|
|
|
|
app.post("/submit", (req, res) => {
|
|
// Process the request data here, which is accessible via req.body
|
|
// For example, log the received data
|
|
console.log(req.body);
|
|
|
|
// Respond to the client
|
|
res.status(200).send("Data received");
|
|
});
|
|
|
|
const PORT = process.env.PORT || 3000;
|
|
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));
|