Skip to content

Commit 9083e3e

Browse files
committed
Data null instead of undefined
1 parent a4144b2 commit 9083e3e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const bodyParse = (req) => new Promise((resolve, reject) => {
6969
req.on('end', () => resolve(body ? JSON.parse(body) : {}))
7070
})
7171

72-
const sendData = (res, data) => {
72+
const sendData = (res, data = null) => {
7373
return res.end(`{"data": ${JSON.stringify(data)}, "error": null}`)
7474
}
7575

0 commit comments

Comments
 (0)