Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const express = require('express')
  2. const app = express()
  3. const port = 3000
  4. var bodyParser = require('body-parser');
  5. //var multer = require('multer'); // v1.0.5
  6. //var upload = multer(); // for parsing multipart/form-data
  7. var dick
  8.  
  9. app.use(bodyParser.json()); // for parsing application/json
  10. app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
  11.  
  12. app.get('/', (req, res) => res.send(`Hello World! Zmienna to ${dick}`))
  13. app.post('/post', dick , function (req, res, next) {
  14.     console.log(req.body);
  15.     res.json(req.body);
  16. });
  17.  
  18. app.listen(port, () => console.log(`Example app listening on port ${port}!`))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement