[aerogear-dev] Custom JS Builder
Lucas Holmquist
lholmqui at redhat.com
Tue Jan 8 11:15:58 EST 2013
from this gist:https://gist.github.com/4485018
Custom Aerogear.js Builder
Prototype here: http://aerogearjsbuilder-lholmqui.rhcloud.com/
myrepo: git at github.com:lholmquist/aerogearjsbuilder.git
There is still a couple of minor tweaks that i need, like better error handling and CORS support possible. although it uses an iframe, so maybe not
This is the way it works.
client side
once you submit, the code builds the query params, then sends it to the server( duh ) using an iframe( atm )
Server side
Server side is a node.js server running on option shift
There is a "base" grunt.js file that has "markers" for the src and destination, This gets read in, replacements are made and then saved( customhash.js ) to a temporary directory( date in millis ). Then a node child proccess, runs grunt using this new custom grunt file, while overiding the "base", where the src files are, and the "config", where the custom grunt file is
once grunt is finished creating the files, the server then zips them up and sends that back to the client.
and then deletes the temporary directory
Src File Storage
The src files are currently stored in the OPENSHIFT_DATA_DIR, this is used for persistent storage and doesn't get recreated after every build.
Currently i need to ssh on to the server and do a git pull to update the repo in this directory.
Not really sure if there is a better way, perhaps a cron, or something.
Originally i had the src files in the project itself, but then moved them out to this persistent directory.
Another idea could when the user does a submit to get the file, it checks to see if the repo is up to date, then if not, updates it. Probably have a time aspect to it, so it only does it everyday for instance
looking for idea's here for the src files
-luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130108/a49b07f9/attachment.html
More information about the aerogear-dev
mailing list