Created
February 10, 2014 11:50
-
-
Save anonymous/8914502 to your computer and use it in GitHub Desktop.
This file contains 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
app.post(/^\/mobiles\/.*/, function (req, res) { | |
var postUrl = "https://d3v0fbs.net" + req.url; | |
console.log(req.body, req.files.imageupload.path); | |
var form = req.body | |
if (req.files && req.files.imageupload) | |
form.pipe(fs.createWriteStream(__dirname + req.files.imageupload.path)) | |
request.post({url:postUrl, form: form}, function (err, r, body) { | |
if (err) { | |
console.log(err); | |
} else { | |
console.log(body); | |
res.json(JSON.parse(body)); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment