Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express')
- const app = express()
- const port = 3000
- var bodyParser = require('body-parser');
- //var multer = require('multer'); // v1.0.5
- //var upload = multer(); // for parsing multipart/form-data
- var dick
- app.use(bodyParser.json()); // for parsing application/json
- app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
- app.get('/', (req, res) => res.send(`Hello World! Zmienna to ${dick}`))
- app.post('/post', dick , function (req, res, next) {
- console.log(req.body);
- res.json(req.body);
- });
- app.listen(port, () => console.log(`Example app listening on port ${port}!`))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement