javascript - Speed up server response for POSTing JSON to an Express.js server -
i trying post base64 string canvas express.js server, console log of post/ takes forever , never logs json content posted.
this use on client:
saveimage: function(e) { var canvas = document.queryselector('#canvaselement'); var base64 = canvas.todataurl(); $.ajax({ type: 'post', url: '/', contenttype: 'application/json', data: base64, success: function(e){ console.log('success', e) } }); }
...then on server:
var express = require('express'), app = express(); app.use(bodyparser.json()); app.post('/', function (request, response) { console.log(request.body); });
Comments
Post a Comment