mixu / gluejs

Build CommonJS modules for the browser via a chainable API
http://mixu.net/gluejs/
165 stars 13 forks source link

Added express middleware support #28

Closed srquinn21 closed 10 years ago

srquinn21 commented 10 years ago

Default implementation should look like:

var express = require('express');
var glue = require('gluejs').middleware;

var app = express();

app.use(express.logger('dev'));

app.use('/js/app.js', glue({
  include: './public/js'
}));
app.use(express.static(__dirname + '/public'));

app.listen(3000);

Notice that include option is the only required parameter. The basepath will default to the include path and the main file will default to index.js in the include path. All other options can be defined in the hash as well.

Let me know if you have any questions/comments/improvements.

srquinn21 commented 10 years ago

I've made some improvements... Will resubmit shortly;