I am new to java script and node JS. I am trying to create a simple app where the user can convert currency values by entering the amount and the currency type. i checked this API request its working fine, but i have no idea how to use html input tag to get the inputs and send it to the API request form.
var unirest = require("unirest");
var req = unirest("GET", "https://currency-exchange.p.rapidapi.com/exchange");
req.query({
"q": "1",
"from": "USD",
"to": "LKR"
});
req.headers({
"x-rapidapi-host": "currency-exchange.p.rapidapi.com",
"x-rapidapi-key": "1599d15183msh1ede0c59134d7c4p1c921bjsnedcdcb4dded9"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});