node.js - POST to express.js with 'Access-Control-Allow-Origin' -
i'm newbie node , express. can data server app fail on post. i have client side on " http://myapp.com " , node app on " http://myapp.com:34627 ". this node app: var express = require('express'), app = express(); var result = {}; app.configure(function() { app.use(express.json()); app.use(express.urlencoded()); }); app.set("jsonp callback", true); app.get('/get/users/:userid/:username',function(req,res) { var userid = req.params.userid; var username = req.params.username; result = { response: 'ok', url_userid: userid, url_username: username }; res.header('access-control-allow-origin','http://listasapp.in'); res.json(200,result); }); app.post('/post/user',function(req,res) { console.log( req.body ); result = { response: 'ok' }; res.jsonp(200,result); }); var server = app.listen(34627,function() { ...