combo-server
Express and connect middleware to combo static assets.
Install
$ npm install combo-server --save
Usage
var config = routes: location: '/mod' root: '/data/static' // Optional // If the pathname of the url doesn't start with '/combo/', // it will skip and go to the next middleware base: '/combo' // Default root to find static files, can be a path string or array of strings root: '/data/old-static' // disable cache cache: false var app = var middleware = configappapp
By default, when visiting:
http://localhost:8888/combo/mod/a.js,mod/b.js
It will returns the comboed content of '/data/static/a.js'
and '/data/static/b.js'
.
- config
Object
- path_parser
function(url, config)
- joiner
function(contents)
- cache
false|Object
set tofalse
to disable cache, or theasync-cache
options
- path_parser
path_parser
Returns Array.<pathname>