angularjs - How to keep yeoman angular app alive using grunt-forever? -
i have yeoman angular based app run grunt serve
.
it critical keep application running time. i've used forever before , it's worked fine works on particular js file. whereas want use grunt serve
task.
i found plugin called grunt-forever - https://github.com/bustardcelly/grunt-forever - don't know how set gruntfile.js use call grunt serve
command.
the server section of grunt file standard 1 gets generated yeoman angular application. follows -
grunt.registertask('serve', function (target) { if (target === 'dist') { return grunt.task.run(['build', 'express:prod', 'open', 'express-keepalive']); } grunt.task.run([ 'clean:server', 'bower-install', 'concurrent:server', 'autoprefixer', 'express:dev', 'open', 'watch' ]); });
anyone know how use grunt-forever call command?
i trying figure out myself today, , came across post on way finding out.
i'm still bit new this, came conclusion grunt more use dev tasks, , not recommended production. (i may wrong on this).
the main pitfalls had trying use grunt (and not being able work out magical incantation), , once figured out should using node directly, getting paths working.
this did in end, app generated daftmonk's generator-angular-fullstack :
sudo npm install forever forever-service -g cd ~/<project directory>/server sudo forever-service install <service name> -s /<full path project directory>/server/app.js -e "path=/usr/local/bin:\$path" --start
the verify what's happening:
tail -f /var/logs/<service name>.log
Comments
Post a Comment