Skip to content

Commit 9055848

Browse files
committed
add #listen(cb)
1 parent 76af3a3 commit 9055848

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const fetch = require('node-fetch')
55

66
class Updates {
77
listen (port, cb) {
8+
if (typeof port === 'function') {
9+
;[port, cb] = [undefined, port]
10+
}
811
const server = http.createServer((req, res) => {
912
this.handle(req, res).catch(err => {
1013
console.error(err.stack)

0 commit comments

Comments
 (0)