Skip to content

Instantly share code, notes, and snippets.

@anatoliychakkaev
Created January 17, 2012 23:07
Show Gist options
  • Save anatoliychakkaev/1629664 to your computer and use it in GitHub Desktop.
Save anatoliychakkaev/1629664 to your computer and use it in GitHub Desktop.
Blackout middleware for express, railwayjs
app.use(function blackoutMiddleware(req, res) {
// obtain static html here: http://www.zachstronaut.com/lab/text-shadow-box/stop-sopa.html
// or here: https://raw.github.com/zachstronaut/stop-sopa/master/index.html
fs.readFile('./public/stopSOPA.html', function (err, file) {
res.send(file.toString(), 503);
});
});
@tj
Copy link

tj commented Jan 18, 2012

res.sendfile() :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment