Best way to deploy an R script with Meteor -


i'm using syncedcron call script written in r using npm.require('child_process'). works fine on local, i've worked out relative path between script , bit of .meteor folder gets called from.

this breaks in production though because app gets bundled , path changes. i'm using mup deploy amazon, , far can see doesn't take r script it.

are there neat solutions deploying non-node bits of code meteor?

good question. here idea below.

  1. have installed r on amazon? if , use unix system ubuntu, use whereis path execute r on amazon

  2. for r script, store in /private folder , use assets

all files inside top-level directory called private accessible server code , can loaded via assets api. can used private data files , files in project directory don't want accessible outside.

assets allows server code in meteor application access static server assets, located in private subdirectory of application's tree. assets not processed source files , copied directly application's bundle.

static server assets included placing them in application's private subdirectory. example, if application's private subdirectory includes directory called nested file called rscript.txt inside it, server code can read rscript.txt running:

var rscript = assets.gettext('nested/rscript.txt'); 

you can pass script along input when execute on server.

(ref)


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -