als-layout 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/layout.js +5 -3
- package/package.json +1 -1
package/lib/layout.js
CHANGED
|
@@ -115,13 +115,15 @@ class Layout extends Document {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
status(statusCode) { this.statusCode = statusCode; return this }
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
|
|
119
|
+
end(res,statusCode = this.statusCode, rawHtml = this.rawHtml) {
|
|
120
|
+
res.writeHead(statusCode);
|
|
120
121
|
if (res.set) res.set('Content-Type', 'text/html') // for Express
|
|
121
122
|
else res.setHeader('Content-Type', 'text/html') // for http
|
|
122
|
-
res.end(
|
|
123
|
+
res.end(rawHtml)
|
|
123
124
|
return this
|
|
124
125
|
}
|
|
126
|
+
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
module.exports = Layout
|