I have a script inside of my .ejs file, the script is very simple, I'm just grabbing the input data from the user and putting inside an object. So, what I want to do is to send this object to my index.js and in my index.js I'm gonna use the data from my object to use in a node module called coap (is very simular to http), but I don't really know how to send my object form a .ejs file to my index.js file which I'm using the express module.
const btnSubmitData = document.getElementById("btnSubmitData")
btnSubmitData.addEventListener("click", () => {
const boardIP = document.getElementById("BoardInputIP").value
const boardMethod = document.querySelector('input[name="inlineRadioOptions"]:checked').value
const boardFunction = document.getElementById("selectFunction").value
const boardPoint = document.getElementById("selectPoint").value
const inputDataBoard = {
ipBoard: boardIP,
methodCoapBoard: boardMethod,
functionBoard: boardFunction,
pointBoard: boardPoint
}
})
don't you have to use ejs to display - not index.js?