Thanks for pushing the envelope on these early Locomotive versions.
I'd recommend checking out the master branch, which is where v0.2.0 is being worked on, and doing development with that (npm link it, if you wish). One of my goals for that is to cleanly expose a standard Express instance so
socket.io and the like can be layered on easily.
When doing that, you wouldn't use the built-in lcm command line to start the server, but rather write your own short myserver.js file, containing something like the following:
myserver.js
var locomotive = require('locomotive');
// Boot Locomotive. Loads routes, controllers, etc from the file system
// and calls back with a fully configured express instance.
locomotive.boot('./path/to/app', 'development', function(err, express) {
if (err) { throw err; }
// Hookup
socket.io. Any other module that runs on top of HTTP could
// be configured here too.
// start Express listening for requests
express.listen(port, address, function() {
var addr = this.address();
debug('listening on %s:%d', addr.address, addr.port);
});
});
Thats it! Now you can just run node myserver.js, and Locomotive will load up your MVC web app and hand you an Express instance for further customization and layering, and you can listen when ready.
I think its going to be pretty slick. Let me know what you think.
Jared