I know Express has the res.contentType() method, but how to set automatically content type based on path/file (including static content)?
Express uses Connect, Connect uses Mime, and Mime includes the files mime.types (with default mime types from Apache) and node.types (with some further types contributed by node community). You could just customize one of these files within your copy of mime in node_modules to add your required content type, or Mime also has an API that lets you specify additional content-types or .types files to load from your code.
https://github.com/broofa/node-mime