action posting

 calci js



const express = require("express");


const app = express();


app.get("/contact", function(req, res){

  res.send("surajkurle2003@gmail.com");

})


app.get("/", function(req, res){

  res.sendFile(__dirname + "/index.html");

})


app.post("/", function(req, res){

  res.send("thanks for posting this")

})


app.listen(3000, function(){

  console.log("server started at port 3000");

})


HTML code


<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>calculator</title>

  </head>
  <h1>my calculator</h1>
  <body>
    <form action="/" method="post">
      <input type="text" name="numq" placeholder="first number">
      <input type="text" name="num2" placeholder="second number">
      <button type="submit" name="submit">calculate</button>

    </form>
  </body>
</html>