Parse body
This commit is contained in:
parent
25f25be78e
commit
cd6aa2ee29
1 changed files with 6 additions and 3 deletions
|
@ -43,7 +43,9 @@ app.use(serveStatic(__dirname + "/content/.vuepress/dist"));
|
|||
|
||||
app.use(cors());
|
||||
|
||||
app.use(bodyParser.text());
|
||||
var textParser = bodyParser.text({
|
||||
limit: '256kb'
|
||||
});
|
||||
|
||||
app.get('/forward', function(req, res) {
|
||||
|
||||
|
@ -105,7 +107,7 @@ app.get('/github-feed', function(req, res) {
|
|||
|
||||
});
|
||||
|
||||
app.post('/upload-image', function(req, res) {
|
||||
app.post('/upload-image', textParser, function(req, res) {
|
||||
|
||||
request({
|
||||
method: "PUT",
|
||||
|
@ -115,6 +117,7 @@ app.post('/upload-image', function(req, res) {
|
|||
},
|
||||
body: req.body,
|
||||
}, function(error, response, body) {
|
||||
body = JSON.parse(body);
|
||||
res.json(body);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue