/** * Adapted from example in multiple sites on web */ const path = require('path') const express = require('express') const app = express(); const port = 30025 app.use("/", express.static(path.join(__dirname))) app.post("/postit", express.json({ type: '*/*' }), function (request, response) { console.log("POST JSONgotten"); console.log(request.body); let aa = { hello: 6, goodbye: "hello" }; for (const [k, v] of Object.entries(request.body)) { aa[k] = v; } response.json(aa) }); app.listen(port, function (error) { if (error) throw error console.log("Server created Successfully") });