jbmusso / gremlin-javascript

JavaScript tools for graph processing in Node.js and the browser inspired by the Apache TinkerPop API
MIT License
214 stars 62 forks source link

issue #29 . Sending as Binary. #31

Closed dmill-bz closed 8 years ago

dmill-bz commented 8 years ago

This should correct the issue with the client not communicating the mimeType to the server.

What the PR covers:

I wasn't able to get npm run test:node to work, got some strange legacy node error ; I think my env isn't setup correctly. So this will need testing as I only have some manual testing going for this PR at the moment.

FYI, my manual testing covers:

dmill-bz commented 8 years ago

Changed the styling a bit. Should be a better match for babel.

jbmusso commented 8 years ago

Thanks for sending this Dylan. Unfortunately, FileReader is a browser API and doesn't work in a Node.js environment. I pushed a branch (see https://github.com/jbmusso/gremlin-javascript/commit/852574f9da2ac352935d867df45a6688b81a81f5?diff=split) where I converted your code to use Buffer.toString() (Buffer is a core Node.js module). I believe Buffer is shimmed when using browserify (I think via https://github.com/feross/buffer). Hopefully this should work in all environments (browsers/Node.js).

Can you checkout this and see if that works in a browser when using browserify?

dmill-bz commented 8 years ago

Ah good I didn't realize that!. I'll close this and test it out.