Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Send Request Express

yourproject/views/index.ejs

<html>
<head><title></title></head>
<body>

<form action="/" method="POST">
<input name="abc" />
<input type="submit" value="submit"/>
</form>
</body>
</html>

yourproject/routers/index.js


var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

router.post("/", async function(Req, res, next)
{
res.send(req.body.abc)

});

module.exports = router;
Source by javasper.hashnode.dev #
 
PREVIOUS NEXT
Tagged: #Send #Request #Express
ADD COMMENT
Topic
Name
5+6 =