What are the express equivalents to Rails' asset pipeline and asset paths

I'm looking to solve two problems:

  • Rewriting URLs in production to use a CDN URL instead of the original domain name
  • Concatenation and minification of client side JS and CSS

There seems to be a few options for for achieving the latter, for example asset-smasher. However I'm finding it hard to find a good solution for rewriting images and other assets. Any libraries out there to help?

Thanks!

For the first, use express.static:

app.use(express.static("/path_to_assets"));

A call to "/images/img.png" will resolve to "/path_to_assets/images/img.png."

For the second, I use grunt/requirejs. But you're right, there are many options.