0.1.1 • Published 11 years ago

plugging v0.1.1

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

plugging

Easy plugin architecture for node.js

Example plugin

var myHandler = require('./myHandler');

function doSomething () {
  //do stuff
}

function setUpCustomRoutes (app) {
  app.get('/custom/route', myHandler);
}

module.exports = function(options) {
  setUpCustomRoutes(options.app);
  doSomething(options.port);
}

To initialize

  var app = require('express')(),
      plugging = require('plugging')(__dirname + '/pluginsFolder'),
      http = require('http');
      
  var server = http.startServer(app);
  
  server.listen(app.get('port'), function () {
    plugging.start({
      app: app,
      port: app.get('port')
    });
  })
0.1.1

11 years ago

0.1.0

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago