Skip to content

sesser/gulp-koa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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).

Sample

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');
});

About

gulp-koa dev server based on gulp-koa-service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published