Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot stop server #64

Closed
andrey-buligin opened this issue Jun 26, 2014 · 2 comments
Closed

Cannot stop server #64

andrey-buligin opened this issue Jun 26, 2014 · 2 comments

Comments

@andrey-buligin
Copy link

Hi,
I am experiencing issues with proper way of closing server.

Here is my watch config
watch: {
compass: {
files: ['<%= yeoman.app %>/styles/{,/}.{scss,sass}'],
tasks: ['compass']
},

        livereload: {
            files: [
                '<%= yeoman.app %>/*.html',
                '{.tmp,<%= yeoman.app %>}/styles/{,**/}*.css',
                '{.tmp,<%= yeoman.app %>}/scripts/{,*/,**/,**/**/}*.js',
                '<%= yeoman.app %>/templates/{,*/,**/,**/**/}*.hbs',
                '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
                'test/spec/{,**/}*.js'
            ],
              options: {
                livereload: 35712
            }
        },

        express: {
            files:  [
                '<%= yeoman.dist %>/*',
                'server/*'
            ],
            tasks: ['express:prod:stop', 'express:prod'],
            options: {
                spawn: false
            }
        }
    };

Here is my grunt task for executing build, build server, opening browser and then watching for changes in dist folder.
grunt.task.run(['build', 'express:prod', 'open:prod', 'watch:express']);

I expect that every time build folder/server files are modified running server should stop and start again. I could see that during 'express:prod:stop' command inside stop Action of server.js 'server' variable is 'undefined' (line 114) so there is nothing to kill. Please suggest how to kill server/process that's already running.

Thanks

@paulpflug
Copy link
Collaborator

options: {
  spawn: false
}

should be in the watch task and not in the express task
then it will work

@andrey-buligin
Copy link
Author

Hi Paul, thanks for response. It's actually Watch->expres, it's not express, first few lines are not included in "code area", anyways I managed to solve issues after updating package to latest version mine was outdated. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants