Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

fixed send json #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

francesco-furlan
Copy link

No description provided.

@andrewshatnyy
Copy link
Collaborator

andrewshatnyy commented Sep 7, 2017

Cheers for the contribution @furlan97, what is the purpose for these explicit sets?
res.send(completeJSON) should suffice the header set. Please let me know otherwise.

@francesco-furlan
Copy link
Author

Hi @andrewshatnyy, also res.json(completeJSON) would be great, however for me it's not working, i've got this error:
{"name":"svc-agent-reader","hostname":"host-1","pid":35692,"level":50,"msg":"sent error res.send is not a function to the cloud","time":"2017-09-07T06:57:14.885Z","v":0} {"name":"svc-agent-reader","hostname":"host-1","pid":35692,"level":50,"err":{"message":"res.send is not a function","name":"TypeError","stack":"TypeError: res.send is not a function\n at giveResponse (/Users/user1/Desktop/mtconnect-agent/src/utils/handlers.js:154:11)\n at Object.current (/Users/user1/Desktop/mtconnect-agent/src/routes/current.js:52:12)\n at current.next (<anonymous>)\n at Object.dispatch (/Users/user1/Desktop/mtconnect-agent/node_modules/koa-router/lib/router.js:334:12)\n at dispatch.next (<anonymous>)\n at onFulfilled (/Users/user1/Desktop/mtconnect-agent/node_modules/co/index.js:65:19)\n at /Users/user1/Desktop/mtconnect-agent/node_modules/co/index.js:54:5\n at Promise (<anonymous>)\n at Object.co (/Users/user1/Desktop/mtconnect-agent/node_modules/co/index.js:50:10)\n at Object.toPromise (/Users/user1/Desktop/mtconnect-agent/node_modules/co/index.js:118:63)"},"msg":"res.send is not a function","time":"2017-09-07T06:57:14.886Z","v":0}

I'm using node v8.4.0.

@andrewshatnyy
Copy link
Collaborator

Will defer to @dskurbatov on this one. Cheers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants