Created
December 25, 2016 09:32
-
-
Save fxp/cc9134f388cc7d6cc730286430645e67 to your computer and use it in GitHub Desktop.
Basic expressjs project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://expressjs.com/en/api.html | |
var app = require('express')(); | |
var bodyParser = require('body-parser'); | |
var multer = require('multer'); // v1.0.5 | |
var upload = multer(); // for parsing multipart/form-data | |
app.use(bodyParser.json()); // for parsing application/json | |
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded | |
app.post('/profile', upload.array(), function (req, res, next) { | |
console.log(req.body); | |
res.json(req.body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment