- Joined
- May 24, 2022
- Messages
- 5
- Reaction score
- 0
i know i am missing something simple but i need to have My console output be displayed in a webpage with express and ejs can anyone help me out
JavaScript:
import express from "express";
import dgram from "dgram";
const socketServer = dgram.createSocket("udp4");
const app = express();
app.get("/", (req, res) => {
//res.send("Hello World!");
});
socketServer.on("message", (msg, rinfo) => {
console.log(`got messsage from ${rinfo.address}, data: ${msg}`);
});
app.listen(5000, () => {
socketServer.bind(5000);
console.log(`Backend started!`);
});