Skip to content

Possibility to reload server #231

Open
@ghost

Description

I'm using connect with socketio and I would like to reload the server and then rerun the onCreateServer function.

Something like this:

watch: {
   serverApi: {
       options: {
        livereload: true
      },
      files: ['bin/www.js']
   }
}

where bin/www.js is a file with a running socket server used like this:

connect: {
      options: {
        port: 9000,
        hostname: 'localhost',
        livereload: 35729,
        debug: true
      },
      livereload: {
        onCreateServer: function(server, connect, options) {
            var socketServer = require('./bin/www');
            socketServer(server);
        }
      }
}

So basically when I change the file that handle the socket server, it reload the connect server, so I don't have to do it manually.

I know that livereload is supposed to work on the browser side, but i'm suggesting something similar to reload the connect sever.

Related to: #117 #83 #217

Many thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions