Skip to content

Commit

Permalink
feat: Implement res.locals behavior (#355) (#356)
Browse files Browse the repository at this point in the history
* feat: Implement res.locals behavior (#355)

* fix: default to empty res.locals object
  • Loading branch information
06000208 committed Jun 6, 2022
1 parent e53a11b commit 1f3aa1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/app/src/response.ts
Expand Up @@ -9,7 +9,7 @@ export const renderTemplate =
(file: string, data?: Record<string, any>, options?: TemplateEngineOptions<O>): Response => {
app.render(
file,
data,
data ? { ...data, ...res.locals } : res.locals,
(err: unknown, html: unknown) => {
if (err) throw err
res.send(html)
Expand Down

0 comments on commit 1f3aa1b

Please sign in to comment.