Can anyone help me with this Express js code?
<-- I am a beginner learning express js and I am trying to make a BMI calculator which result is computed in my localhost:3000/bmicalculator (server) Everything works fine but the result(var) BMI returns NaN BMI is nothing but a body mass index (simple formula) BMI formula = weight/height*height --> <--bimCalculator.html--> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>BIM Calculator</title> </head> <body> <h1>BIM Calculator</h1> <form action="/bmicalculator" method="post"> <input type="text" name="height" placeholder="height"/> <input type="text" name= "weigth" placeholder="weigth"> <button type="submit">Calulate BIM</button> </form> </body> </html> //calculator.js below const express = require("express"); const bodyParser = require("body-parser"); //2. Bodypasser const app = express(); app.use(bodyParser.urlencoded({extended: true})); //BIM Calculator app.get("/bmicalculator", function(req, res){ res.sendFile(__dirname + "/bmiCalculator.html"); }); //post app.post("/bmicalculator",function(req,res){ var h=parseFloat(req.body.height); var w=parseFloat(req.body.weight); var bmi = w/(h*h); res.send("The BIM is "+ bmi); //bmi returns NaN which is the problem }); app.listen(3000, function(){ console.log("Successfull Sandesh on 3000"); });