gulp-service

gulp plugin for spawning processes and services such as restful api servers


Keywords
gulp, express, process, spawn, service, server, api
License
WTFPL
Install
npm install gulp-service@0.0.3

Documentation

gulp-service

travis npm-dependencies standard-js npm-package-quality npm-node-version npm-version npm-license

This plugin is using node's child processes to let you run individual services such as restful api-servers, thus, may be restarted according to your neeeds. Issues should be reported using github's issues tracker.

install

npm install gulp-service --save-dev

example

// gulpfile.js

var gulp = require('gulp')
  , service = require('gulp-service');

gulp.task('run:service', function(){
  service.run('app/index.js', {
    env: {
      port: 8080
    }
  });
});

gulp.task('watch', function(){
  gulp.watch(['app/**'], ['run:service']);
});
// app/index.js

var express = require('express')
  , app = module.exports.app = exports.app = express();

app.get('/', function(req, res){
  res.send('service is up!');
})

app.listen(process.env.port);