1.0.0 • Published 9 years ago

serve-static-x v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

serve-static-x NPM version Build Status Dependency Status

Serve static files with cache busting capability; uses Express.static() aka serve-static

Use it just like serve-static except now you can set an additional option named "x" that enables a custom (secret) request header to be used to bypass receiving static files.

  • Use in conjunction with save-static for caching and re-caching files to disk.

Install

$ npm install --save serve-static-x

Usage

var express = require('express');
var serveStaticX = require('serve-static-x');

var app = express();

var staticPath = path.join(__dirname, '/static/html'); // <= for example

// this is where the magic happens
app.use(serveStaticX(staticPath, {
  x: 'x-my-secret-cache-busting-header'
}));

License

ISC © Buster Collings