mini-file
v0.0.19
Published
mini-route static file handler extension.
Downloads
4
Maintainers
Readme
mini-file
mini-route static file handler extension.
Example:
var http = require('http');
var MiniRoute = require('mini-route');
var miniFile = require('mini-file');
var server = http.createServer();
var router = new MiniRoute(server);
miniFile(router, __dirname + '/public');
miniFile(router, __dirname + '/bower_components', '/support/'); // don't forget the extra slash at the end
// the above serves the 'bower_components' folder on '/support/'
server.listen(8080);
This can also be used with Express:
var miniFile = require('mini-file');
var app = require('express')();
miniFile(app, __dirname + '/public');
app.listen(8080);