Connecting Shiny server front end to node.js backend files

1,000 views
Skip to first unread message

eva...@gastrograph.com

unread,
Jun 18, 2014, 11:32:14 AM6/18/14
to shiny-...@googlegroups.com
So I have a shiny-server which works great and does what I want it to do.  The next step I want to do is really get shiny server integrated well with node.js, specifically I want to use libraries such as stripe to work with and display information.  Is there a way to use other node.js files with shiny-server?  I know a good amount about javascript, but very little about node.js.

I know I could use RCurl to integrate with Stripe, but if I can get it working well with node.js it will open many opportunities for further application growth.

Thank you,
Evan

Joe Cheng

unread,
Jun 18, 2014, 12:31:18 PM6/18/14
to eva...@gastrograph.com, shiny-...@googlegroups.com
Shiny Server is implemented in node.js but not designed to be extended directly with your own node.js code. However, what you could do is put another server in front of it, written in node.js, go, or whatever, and proxy requests intended for shiny server to your shiny-server instance. That's a really nice thing about HTTP servers/proxies, they compose very nicely.

Just be aware that your proxying logic ideally will support not only HTTP but also WebSockets. Or you could disable websockets in shiny-server, then you'd only need to proxy HTTP--this would just be a little less efficient but otherwise should work OK (it's what we currently do on ShinyApps.io).


--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eva...@gastrograph.com

unread,
Jun 18, 2014, 2:39:17 PM6/18/14
to shiny-...@googlegroups.com, eva...@gastrograph.com
Hmm, that sure does sound interesting.  The only thing that confuses me is communicating information between the two if the node.js server is simply proxying requests to the shiny-server instance.

Joe Cheng

unread,
Jun 18, 2014, 5:31:17 PM6/18/14
to eva...@gastrograph.com, shiny-...@googlegroups.com
Oh, if you're doing more than, say, charging for access to apps (which you can do just by blocking or allowing access to certain URL patterns based on who's logged in and what they've bought) then there might need to be a more involved solution.
Reply all
Reply to author
Forward
0 new messages