hot to run grunt serve with grunt-forever

573 views Asked by At

i use yeoman angular generator and i need to run grunt serve forever (grunt-forever) I tried (gruntfile.js) like these:

grunt.loadNpmTasks('grunt-forever');

grunt.initConfig({
  forever: {
      options: {
          index: 'app/scripts/app.js' (im not sure which file must be here)
      }
    },

 grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'forever:server1:start']);
    }

 grunt.task.run([
  'clean:server',
  'wiredep',
  'concurrent:server',
  'postcss:server',
  'connect:livereload',
  'watch'
 ]);
});

when i try "grunt serve", or "grunt forever:start" - "Verifying property forever.start exists in config...ERROR

Unable to process task. Warning: Required config property "forever.start" missing. Use --force to continue." What should i do?

1

There are 1 answers

0
Fatih Aktepe On

You can use pm2 for running your application on the server. Check this out; https://github.com/Unitech/pm2