How to run coffeescript via StrongLoop controller -
i'm making loopback application , wonder how can use coffeescript on serverside, use slc run
?
i've used loopback recently, , wrote backend code in coffeescript. catch can't use slc run
command run it. instead, after generating initial application skeleton slc
, rewrite main server file in coffeescript. quickest way convert js2coffee:
npm install -g js2coffee js2coffee server/server.js > server/server.coffee rm server/server.js
then kickoff loopback server using coffee
instead of slc run
npm install -g coffee-script coffee server/server.coffee
this starts server other node.js app, , write of server files in coffeescript, without needing precompile them first grunt
, etc.
if feel you're missing out on of bonus features of slc run
clustering , process monitoring, try pm2 generalized alternative. supports coffeescript out of box. in future (hint hint, strongloop), slc
tool will, too.
Comments
Post a Comment