I need to create express server that has 1 post endpoint which gets POST data and print it in the console where the server is started:
var express = require("express");
var app = express();
app.get("/", function (req, res) {
res.send("GET request");
});
app.post("/", function (req, res) {
console.log(req.params);
res.send("POST request");
});
app.listen(2705, function () {
console.log("Server is running on port: " + 2705);
});
enter code here
Cannot find a solution how to print this POST request in the console when for example the request is from another local server.