Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all articles
Browse latest Browse all 5028

Node custom scripting error

$
0
0

Hello folks,
I have DF installed in windows with Admin Application Version: 2.1.3 ,DreamFactory Version: 2.1.0

  1. I added custom server side script using the example - math node.js script by following exact steps provided in the blog http://blog.dreamfactory.com/server-side-scripting-with-node.js

  2. Added swagger service definition with the help of this blog..
    http://blog.dreamfactory.com/put-some-swagger-in-your-dreamfactory-custom-scripting-services

  3. updated DF_NODEJS_PATH in .env file to point to node installables

  4. node.js version is v 4.5.0

When trying to test using swagger, i am getting nulls as result.

Request URL: localhost/api/v2/math/add?n1=10&n2=10
Response Body : ""
Response Code:200

Checked the log and it has following messages -

[2016-08-30 03:28:58] local.ERROR: * Script did not return an array:
[2016-08-30 03:28:58] local.DEBUG: Service event: math.get.post_process
[2016-08-30 03:29:08] local.DEBUG: Service event: math.get.pre_process
[2016-08-30 03:29:09] local.ERROR: Exception executing javascript: Node script returned with error code: 1

Please let me know what is that i am missing.. causing this error to appear..

SS


Viewing all articles
Browse latest Browse all 5028