Skip to content
Myr

Added default view engine support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Now app.set("view engine", "jade") allows you to res.render("jade")

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent c1b3546 · Browse files · 2 files+17 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+17 added−0 removed

  • tests:+11 added−0 removed
  • other:+6 added−0 removed

2 files+17 added−0 removed

modified:lib/express/view.js+6 added
178 unmodified lines
179 */180181http.ServerResponse.prototype.render = function(view, options, fn){182 options = options || {};183 var defaultEngine = this.app.set('view engine');184185 // Support "view engine" setting186 if (view.indexOf('.') < 0 && defaultEngine) {187 view += '.' + defaultEngine;188 }189190 // Defaults191 var self = this,192 root = viewRoot(this.app),193 ext = extname(view),
75 unmodified lines
modified:test/view.test.js+11 added