Skip to content

Instantly share code, notes, and snippets.

Created December 12, 2012 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0471f420c42b4b4e101b to your computer and use it in GitHub Desktop.
Save anonymous/0471f420c42b4b4e101b to your computer and use it in GitHub Desktop.
fs.readFile('index.html', 'utf8', function (err, html) {
if (err) throw err;
var my_template = require("./index");
var output = my_template.render(content);
var headers = [[ 'Content-Type', 'text/html' ],
[ 'Cache-Control', 'no-cache, no-store, must-revalidate'],
[ 'Pragma', 'no-cache'],
[ 'Expires', '0' ]];
_.each(headers, function(header) {
res.setHeader(header[1], header[2]);
});
res.send(output);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment