#gulp-koa#
Wrote this gulp based on gulp-koa-service because I wanted a way to pass in env vars. First stab at it so take it easy on me. Also, I realize there's not tests for it (yet).
var gulp = require('gulp'),
service = require('gulp-koa');
gulp.task('build', function() {
// your brilliant build goes here
});
gulp.task('server', ['build'], function() {
// Starts a server
gulp.src('./src/**/*.js')
.pipe(service('./build/server.js', { env: { NODE_ENV: 'development', DEBUG: '*' }}));
// watch your files!
var watcher = gulp.watch('./src/**/*.js', ['build']);
watcher.on('change', function(event) {
console.log(event.path + ' ' + event.type);
// reload the server
gulp.src('./src/**/*.js')
.pipe(service('./build/server.js', { env: { NODE_ENV: 'development', DEBUG: '*' }}));
});
});
gulp.task('stop', function(){
// Stops a server (by pid)
service.stop('./build/server.js');
});