Skip to content

Commit e5f6fd2

Browse files
committed
feat: Use Default Template
We switch to the Express-PREP supplied default template (based on the updated RFC822 template in v0.4 of Express-PREP) to generate notifications. Instead of passing the response object, we pass only the arguments that stray from the default.
1 parent ed9d798 commit e5f6fd2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/handlers/notify.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module.exports = handler
22

3-
const rfc822Template = require('express-prep/templates').rfc822
4-
53
function handler (req, res, next) {
64
res.events.prep.trigger({
7-
generateNotifications: () => `\r\n${rfc822Template({ res })}`
5+
generateNotifications: () => `\r\n${res.events.prep.defaultNotification({
6+
...(res.method === 'POST') && { location: res.getHeader('Content-Location') }
7+
})}`
88
})
99
next()
1010
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)