Skip to content
masterclass Buddy

Express.js · Method

view engine

Configure a view directory and template engine, then use res.render() to turn a template and local values into an HTML response. Express can infer the template extension when the engine is configured.

Last updated

Syntax

res.render(view [, locals] [, callback])

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • app.set()
  • res.locals
  • app.locals
  • res.send()
  • app.engine()

Source: Using template engines with Express · Express.js 5.x. Checked 2026-11-03.