{ "id": "121116", "key": "AC-2572", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2013-10-15T22:51:45.000+0000", "created": "2013-10-11T21:24:51.000+0000", "labels": [ "Node.ACS" ], "versions": [], "issuelinks": [], "assignee": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:38.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14552", "name": "Appcelerator CLI", "description": "Please enter tickets related to Tooling and the CLI here" } ], "description": "Hi PK\r\n\r\nI have started to create what I try to sell, i.e. a Node.ACS custom connector to a web API that I want to host in the cloud in the MobileFirst way.\r\n\r\nI have made a nodejs server, handling http requests to web API with the \"request\" module, I have used the built in http module to handle incoming GET requests. \r\n\r\nIn the documentation it says that I can upload a standard nodejs module to the cloud, but it does not seem to work well.\r\nI am sure I am doing this wrong, so this is not a bug, even so I have scraped gut hub, your docs, google and other remote places and cannot find any example of how to receive http requests in any other way then through the config.json filtering, this is not standard nodejs. I also want to be able to request data from a web service with http requests, I use the \"request\" module for this.\r\n\r\nIt seems I can start the module in the cloud from studio, I can see my code runs, but I get errors and above all I am not sure how to handle the https uri that I get from the publish script in pespective to the http.createServer function, in which I state the port and ip number, in my case I use the localhost, which I suppose should be different in the cloud, but what do I set it to? I want users to make GET requests to my URL and how do I call the createServer function?\r\n\r\nFrom the client side? Should I use some key in tiapp.xml? It says so in the dialog, out the URI in the tiapp.xml? Ok, where? Really I don+t see it, there is a cloud url, but does that one not have to be the set url so thaht I can call the ACS cloud as normal?\r\n\r\nThe whole idea around the mobile first shift is to host your custom backends in the cloud so that you can manage the data and reach it in a unison way, like SAP or Sharepoint, now with my custom connector I need to have those two fundamental features working and I would like to use my already working script in node.ACS as the doc says it should be possible.\r\n\r\nIn other words I can´t find docs describing these things more in detail, and I cannot find examples, can you please help me or find someone that can? \r\n\r\nI will attach the code used in the server side node. It works well local of course...\r\n\r\nthe example.js code can be run with node in terminal.\r\n\r\nI tool that code and put it into the node.ACS project and disbaled the MVC framework, added dependancy and published to cloud, it runs but do not ask for data from web API, and I do not know how to call GET on the uri provided..\r\n\r\nI know this might seem like basic questions, in the Mobile App I can handle this but in node, .... \r\n\r\nI attach the node.ACS as well for reference..\r\n\r\nAny comment or hint before weekend would be great as I will work with it.\r\n\r\nthanks", "attachment": [ { "id": "43130", "filename": "example.js", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-11T21:24:51.000+0000", "size": 2212, "mimeType": "application/x-javascript" }, { "id": "43133", "filename": "Skärmavbild 2013-10-11 kl. 11.11.00 PM.png", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-11T21:24:51.000+0000", "size": 39063, "mimeType": "image/png" }, { "id": "43132", "filename": "Skärmavbild 2013-10-11 kl. 11.16.17 PM.png", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-11T21:24:51.000+0000", "size": 36158, "mimeType": "image/png" }, { "id": "43131", "filename": "Skärmavbild 2013-10-11 kl. 11.18.43 PM.png", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-11T21:24:51.000+0000", "size": 84341, "mimeType": "image/png" }, { "id": "43129", "filename": "WindmineService.zip", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-11T21:24:51.000+0000", "size": 661564, "mimeType": "application/zip" } ], "flagged": false, "summary": "How to get a http request working and the http.createServer in standard nodes of the Node.ACS space?", "creator": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Node.ACS", "comment": { "comments": [ { "id": "275213", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\r\n\r\nthis looks more like a question for the Q&A Site than a bug. Please go to it at:\r\n\r\nhttp://developer.appcelerator.com/questions/newest\r\n\r\nif you feel that this is a bug, please follow the guide for bug reporting:\r\n\r\nhttps://wiki.appcelerator.org/display/tis/Reporting+Bugs+or+Requesting+Features#ReportingBugsorRequestingFeatures-BugSubmissionSteps\r\n\r\nBest,\r\n\r\nMauro \r\n", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-10-15T22:51:45.000+0000", "updated": "2013-10-15T22:51:45.000+0000" }, { "id": "288886", "author": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Jörgen, \r\n\r\nI took the project that you uploaded in a zip and was not able to reproduce your errors on the cloud. Navigating to the URL that studio outputs provides a functional JSON feed. I was able to access the data from a mobile app with a Ti.Network.HTTPClient. Here is what that code looked like:\r\n\r\n{code}\r\nvar xhr = Ti.Network.createHTTPClient();\r\nxhr.onload = function(){\r\n var json = JSON.parse('['+this.responseText+']');\r\n \r\n //example access of length\r\n alert(json.length);\r\n}\r\nxhr.open('GET', 'url to your standard node app');\r\nxhr.send();\r\n{code}\r\n\r\nMore info on the HTTPClient can be found here...\r\nhttp://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient\r\n\r\nHopefully this sheds some light on the issue.\r\n- Seth\r\n\r\n", "updateAuthor": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-20T21:48:06.000+0000", "updated": "2014-01-20T22:21:12.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }