Hi All,
I am trying to make a simple NodeACS app in which I want to receive some data in xml format as request from cURL and in Node ACS app after receiving that data I want to send response to client.
My system configurations are:
Node v0.10.13 (x86)
Titanium SDK version: Titanium Studio, build: 3.4.0.201409261227 Build: jenkins-titanium-rcp-master-197 (origin/master)
OS: Windows 7 64 bit
Following is my code files:
application.js:
function index(req, res) {
console.log(req.headers);
req.on('data', function (data) {
console.log("Data received successfully");
});
req.on('end', function () {
res.writeHead(200);
res.end();
});
}
config.json:
{
"routes":
[
{ "path": "/", "method":"POST", "callback": "application#index" }
],
"filters":
[
{ "path": "/", "callback": "" }
],
"websockets":
[
{ "event": "", "callback": ""}
]
}
I'm running my code from command prompt as:
acs run --port 7788
There are no changes made by me in any other file
The issue is when I'm trying to POST XML data via curl using following command :
curl -X POST -d @output.xml http://localhost:7788/
then only headers is getting printed in console as:
D:\GMON-Server\GMON-Server>acs run --port 7788
ACS: Appcelerator Cloud Services Command-Line Interface, version 1.0.20
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
[INFO] No dependencies detected
[INFO] socket.io started
[INFO] ACS started on port 7788
[INFO] { 'user-agent': 'curl/7.39.0',
host: 'localhost:7788',
accept: '*/*',
'content-length': '55580',
'content-type': 'application/x-www-form-urlencoded',
expect: '100-continue' }
and neither the req.on('data') event nor the req.on('end') event is firing.
Please tell me whether there is any configuration issue or there is something wrong with my code?