Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. const express = require('express')
  2.  
  3. const router = express.Router()
  4.  
  5. router.get('/add-product', (req, res, next) => {
  6. res.send('<form action="/product" method="POST"><input type="text" name="title"><button type="submit">Add to cart</button></form>')
  7. })
  8.  
  9. router.post('/product', (req, res, next) => {
  10. console.log('rrrr', req.body)
  11. res.redirect('/')
  12. })
  13.  
  14. module.exports = router
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement