Skip to content

Instantly share code, notes, and snippets.

@jameswyse
Created August 25, 2012 07:15
Show Gist options
  • Save jameswyse/3462004 to your computer and use it in GitHub Desktop.
Save jameswyse/3462004 to your computer and use it in GitHub Desktop.
Express 3 locals
app.use(function(req, res, next) {
res.locals = {
keywords: config.app.meta_keywords,
description: config.app.meta_description,
url: url.parse(req.url).href
};
next();
};
<meta name="keywords" content=keywords>
<meta name="description" content=description>
<link rel="canonical" href=url>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment