1.0.1 • Published 12 years ago

connect-mounter v1.0.1

Weekly downloads
8
License
-
Repository
github
Last release
12 years ago

You give connect-mounter a path to a directory with other directores that contain server.js or app.js and export a connect app, it mounts them according to the name of the directory.

Example

git clone git://github.com/SpotterRF/connect-mounter.git
cd connect/mounter/examples/
ls mounts/
# eggman/ walrus/
node server 4080 &
curl http://localhost:4080/eggman
curl http://localhost:4080/walrus

Usage

npm install mounter

my-mounter.js:

(function () {
  "use strict";

  var mounter = require('connect-mounter')
    , port = process.argv[2]
    , server
    ;

  mounter.create('/path/to/mounts');

  function listening() {
    console.info('Listening on ' + server.address().address + ':' + server.address().port);
  }

  if (port) {
    server = mounter.listen(port, listening);
  } else {
    server = mounter.listen(listening);
  }
}());
1.0.1

12 years ago

1.0.0

12 years ago