Skip to content

Instantly share code, notes, and snippets.

@juandopazo
Created August 18, 2012 23:49
Show Gist options
  • Save juandopazo/3390395 to your computer and use it in GitHub Desktop.
Save juandopazo/3390395 to your computer and use it in GitHub Desktop.
Express static route
var express = require('express');
module.exports = function staticRoute(dir, opts) {
var static = express.static(dir, opts);
return function (req, res, next) {
static({ url: req.params[0] }, res, next);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment